QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#321206#692. Delete the PointsxmbWA 1ms3916kbC++141.6kb2024-02-04 10:05:062024-02-04 10:05:07

Judging History

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

  • [2024-02-04 10:05:07]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3916kb
  • [2024-02-04 10:05:06]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
int t,n;
struct node{
	int x,y;
}mp[3010];
bool cmp(node a,node b){
	if(a.x!=b.x)
		return a.x<b.x;
	return a.y<b.y;
}
deque<node> que;
node xx,yy,zz;

signed main(){
//	freopen("stone10.in","r",stdin);
//	freopen("stone10.ans","w",stdout);
		scanf("%lld",&n);
		puts("Yes");
		for(int i=1;i<=n;i++)
			scanf("%lld%lld",&mp[i].x,&mp[i].y);
		sort(mp+1,mp+n+1,cmp);
		for(int i=1;i<=n;i++)	que.push_front({mp[i].x,mp[i].y});
		while(que.size()>=3){
			xx=*que.begin();	que.pop_front();
			yy=*que.begin();	que.pop_front();
			zz=*que.begin();
			if(xx.x==yy.x)
				cout<<yy.x<<" "<<yy.y<<" "<<yy.x+(xx.y-yy.y)<<" "<<xx.y<<"\n";
			else{
				if(yy.y<=xx.y)
					cout<<yy.x<<" "<<yy.y<<" "<<max(xx.x-yy.x,xx.y-yy.y)+yy.x<<" "<<max(xx.x-yy.x,xx.y-yy.y)+yy.y<<"\n";
				else{
					if(zz.x==yy.x&&zz.y>xx.y){
						cout<<zz.x<<" "<<zz.y<<" "<<zz.x+(yy.y-zz.y)<<" "<<yy.y<<"\n";
						que.pop_front();	que.push_front(xx);
					}
					else if(zz.x==yy.x&&zz.y==xx.y){
						if(yy.y-zz.y<=xx.x-zz.x){
							cout<<(double)(zz.x)-0.5<<" "<<zz.y<<" "<<(double)(zz.x)-0.5+(double)(yy.y-zz.y)<<" "<<yy.y<<"\n";
							que.pop_front();	que.push_front(xx);
						}
						else{
							cout<<zz.x<<" "<<zz.y<<" "<<xx.x<<" "<<zz.y+(xx.x-zz.x)<<"\n";
							que.pop_front();	que.push_front(yy);
						}
					}
					else
						cout<<yy.x<<" "<<xx.y<<" "<<yy.x+max(yy.y-xx.y,xx.x-yy.x)<<" "<<xx.y+max(yy.y-xx.y,xx.x-yy.x)<<"\n";
				}
			}
		}
		cout<<0<<" "<<0<<" "<<1000000000<<" "<<1000000000<<"\n";
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3664kb

input:

4
1 1
2 2
5 5
6 6

output:

Yes
5 5 6 6
0 0 1000000000 1000000000

result:

ok OK

Test #2:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

4
0 0
1 2
2 1
4 4

output:

Yes
2 1 5 4
0 0 1000000000 1000000000

result:

ok OK

Test #3:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

4
1 2
3 2
2 1
2 3

output:

Yes
2 2 3 3
0 0 1000000000 1000000000

result:

ok OK

Test #4:

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

input:

6
12 9
1 5
10 14
20 14
15 4
7 9

output:

Yes
15 4 25 14
10 9 15 14
0 0 1000000000 1000000000

result:

ok OK

Test #5:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

10
39 72
59 52
23 17
2 31
30 0
25 88
2 36
61 23
4 96
59 76

output:

Yes
59 52 83 76
39 23 88 72
25 0 113 88
4 17 83 96
0 0 1000000000 1000000000

result:

ok OK

Test #6:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

10
53 95
37 51
84 11
3 39
31 20
37 84
42 27
95 38
6 6
16 19

output:

Yes
84 11 111 38
42 27 110 95
37 51 70 84
16 19 31 34
0 0 1000000000 1000000000

result:

ok OK

Test #7:

score: -100
Wrong Answer
time: 1ms
memory: 3916kb

input:

3000
997371332 135791687
997371332 135791686
997371332 135791685
997371333 135791685
997371333 135791687
997371334 135791687
997371333 135791688
997371331 135791686
997371333 135791689
997371334 135791686
997371334 135791689
997371333 135791684
997371332 135791689
997371331 135791685
997371334 13579...

output:

Yes
9.97371e+08 135791684 9.97371e+08 135791685
997371370 135791683 997371371 135791684
997371370 135791677 997371371 135791678
997371370 135791674 997371372 135791676
997371369 135791684 997371370 135791685
997371369 135791679 997371373 135791683
997371369 135791677 997371370 135791678
997371369 13...

result:

wrong answer Expected double but found NAN.