QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#547974#9177. String and Nailsparamec1um#WA 182ms8600kbC++201.2kb2024-09-05 14:18:482024-09-05 14:18:48

Judging History

你现在查看的是最新测评结果

  • [2024-09-05 14:18:48]
  • 评测
  • 测评结果:WA
  • 用时:182ms
  • 内存:8600kb
  • [2024-09-05 14:18:48]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define IN inline
const int maxn=2e5+10;
struct Point{
    double x,y;
	int id=0;
    //排序为Andrew凸包算法做准备
    IN bool operator<(const Point &t)const {//按照x排序
        if(y!=t.y) return y<t.y;
        return x>t.x;//y相同按照x排序
    }
    IN Point operator+(const Point &t)const {return {x+t.x,y+t.y};}
    IN Point operator-(const Point &t)const {return {x-t.x,y-t.y};} 
    IN Point operator*(const double &t)const {return {x*t,y*t};}//数乘
    IN double operator*(const Point &t)const {return x*t.y-y*t.x;} //叉积 
    friend ostream & operator<<(ostream &out,const Point &t);
}a[maxn];
ostream & operator<<(ostream &out,const Point &t){out<<t.x<<' '<<t.y;return out;}
IN double sqr(double x){return x*x;}
IN double dis(Point a){return sqr(a.x)+sqr(a.y);}//距离平方
void solve(){
	int n;cin>>n;
	for(int i=1;i<=n;++i){
		cin>>a[i].x>>a[i].y;
	}
	sort(a+1,a+1+n);
	cout<<"YES\n";
	for(int i=1;i<n;++i)cout<<a[i]<<'\n';
	
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//fstream in("in.txt",ios::in);cin.rdbuf(in.rdbuf());
	int T=1;//cin>>T;
	while(T--)solve();
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 8596kb

input:

3
1 1
2 4
3 1

output:

YES
3 1
1 1

result:

ok Everything ok

Test #2:

score: 0
Accepted
time: 1ms
memory: 8600kb

input:

1
1000000000 0

output:

YES

result:

ok Everything ok

Test #3:

score: -100
Wrong Answer
time: 182ms
memory: 8552kb

input:

200000
500000000 500000000
500244009 499720246
500488018 499440492
500732027 499160738
500976036 498880984
501220045 498601230
501464054 498321476
501708063 498041722
501952072 497761968
502196081 497482214
502440090 497202460
502684099 496922706
502928108 496642952
503172117 496363198
503416126 496...

output:

YES
5.48558e+08 4.44329e+08
5.48838e+08 4.44573e+08
5.48314e+08 4.44609e+08
5.49117e+08 4.44817e+08
5.48594e+08 4.44853e+08
5.4807e+08 4.44888e+08
5.49397e+08 4.45061e+08
5.48873e+08 4.45097e+08
5.4835e+08 4.45132e+08
5.47826e+08 4.45168e+08
5.49677e+08 4.45305e+08
5.49153e+08 4.45341e+08
5.48629e+0...

result:

wrong output format Expected integer, but "5.48558e+08" found