QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#56113#692. Delete the Pointsfeecle6418WA 3ms3888kbC++201.3kb2022-10-17 09:35:432022-10-17 09:35:45

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-17 09:35:45]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3888kb
  • [2022-10-17 09:35:43]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
typedef array<int,2> S;
int n;
S a[3005];
void Solve(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&a[i][0],&a[i][1]);
	sort(a+1,a+n+1);
	puts("Yes");
	for(int i=n/2;i>=1;i--){
		int x=2*i,y=2*i-1;
		if(a[x][0]==a[y][0]){
			cout<<a[x][0]<<' '<<a[x][1]<<' ';
			cout<<a[x][0]+(a[x][1]-a[y][1])<<' '<<a[y][1]<<'\n';
			continue;
		}
		if(a[x][1]>=a[y][1]){
			cout<<a[y][0]<<' '<<a[y][1]<<' ';
			int w=max(a[x][0]-a[y][0],a[x][1]-a[y][1]);
			cout<<a[y][0]+w<<' '<<a[y][1]+w<<'\n';
			continue;
		}
		int z=2*i-2;
		if(z==0||a[z][0]!=a[y][0]||a[z][1]<a[x][1]){
			cout<<a[y][0]<<' '<<a[x][1]<<' ';
			int w=max(a[x][0]-a[y][0],a[y][1]-a[x][1]);
			cout<<a[y][0]+w<<' '<<a[x][1]+w<<'\n';
			continue;
		}
		if(a[z][1]>a[x][1]){
			cout<<a[z][0]<<' '<<a[z][1]<<' ';
			cout<<a[z][0]+(a[y][1]-a[z][1])<<' '<<a[y][1]<<'\n';
			swap(a[x],a[z]);
			continue;
		}
		if(a[y][1]-a[z][1]<=a[x][0]-a[z][0]){
			printf("%.1lf %d ",a[y][0]-0.5,a[y][1]);
			printf("%.1lf %d\n",a[y][0]-0.5+(a[y][1]-a[z][1]),a[z][1]);
			swap(a[x],a[z]);
		}
		else {
			cout<<a[z][0]<<' '<<a[z][1]<<' ';
			cout<<a[x][0]<<' '<<a[z][1]+(a[x][0])<<'\n';
			swap(a[y],a[z]);
		}
	}
}
int main(){
	int t=1;
	//scanf("%d",&t);
	while(t--)Solve();
}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 3748kb

input:

4
1 1
2 2
5 5
6 6

output:

Yes
5 5 6 6
1 1 2 2

result:

ok OK

Test #2:

score: 0
Accepted
time: 2ms
memory: 3708kb

input:

4
0 0
1 2
2 1
4 4

output:

Yes
2 1 5 4
0 0 2 2

result:

ok OK

Test #3:

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

input:

4
1 2
3 2
2 1
2 3

output:

Yes
2 2 3 3
1 1 2 2

result:

ok OK

Test #4:

score: 0
Accepted
time: 2ms
memory: 3712kb

input:

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

output:

Yes
15 4 25 14
10 9 15 14
1 5 7 11

result:

ok OK

Test #5:

score: 0
Accepted
time: 2ms
memory: 3648kb

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
2 36 7 31

result:

ok OK

Test #6:

score: 0
Accepted
time: 2ms
memory: 3624kb

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 84 70 51
16 19 31 34
3 6 36 39

result:

ok OK

Test #7:

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

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
997371369.5 135791685 997371370.5 135791684
997371370 135791683 997371371 135791684
997371370 135791678 997371371 135791677
997371370 135791676 997371372 135791674
997371369 135791684 997371370 135791685
997371369 135791679 997371373 135791683
997371369 135791677 997371370 135791678
997371369 13...

result:

ok OK

Test #8:

score: 0
Accepted
time: 2ms
memory: 3708kb

input:

36
199 305
199 307
202 306
203 309
201 308
203 308
199 304
198 307
198 304
201 304
200 307
200 305
203 307
203 304
203 305
201 305
201 307
200 309
202 309
201 309
198 306
199 306
200 304
198 309
198 305
200 306
202 304
201 306
199 309
203 306
198 308
202 308
199 308
202 305
202 307
200 308

output:

Yes
203 309 204 308
203 307 204 306
203 305 204 304
202 309 203 308
202 307 203 306
202 305 203 304
201 309 202 308
201 307 202 306
201 305 202 304
200 309 201 308
200 307 201 306
200 305 201 304
199 309 200 308
199 307 200 306
199 305 200 304
198 309 199 308
198 307 199 306
198 305 199 304

result:

ok OK

Test #9:

score: 0
Accepted
time: 2ms
memory: 3680kb

input:

128
6357 4491
6356 4510
6357 4490
6357 4498
6356 4492
6355 4502
6357 4506
6356 4499
6355 4508
6355 4493
6355 4516
6358 4510
6357 4497
6357 4515
6357 4513
6358 4512
6357 4509
6357 4494
6356 4500
6355 4491
6356 4497
6355 4501
6358 4503
6357 4501
6356 4515
6358 4513
6355 4499
6355 4505
6358 4517
6358 4...

output:

Yes
6358 4520 6359 4519
6358 4518 6359 4517
6358 4516 6359 4515
6358 4514 6359 4513
6358 4512 6359 4511
6358 4510 6359 4509
6358 4508 6359 4507
6358 4506 6359 4505
6358 4504 6359 4503
6358 4502 6359 4501
6358 4500 6359 4499
6358 4498 6359 4497
6358 4496 6359 4495
6358 4494 6359 4493
6358 4492 6359 4...

result:

ok OK

Test #10:

score: 0
Accepted
time: 3ms
memory: 3792kb

input:

1444
122394525 884625474
122394544 884625449
122394537 884625450
122394534 884625441
122394526 884625452
122394541 884625446
122394523 884625443
122394529 884625461
122394521 884625462
122394535 884625470
122394521 884625444
122394507 884625440
122394508 884625448
122394537 884625463
122394507 88462...

output:

Yes
122394544 884625474 122394545 884625473
122394544 884625472 122394545 884625471
122394544 884625470 122394545 884625469
122394544 884625468 122394545 884625467
122394544 884625466 122394545 884625465
122394544 884625464 122394545 884625463
122394544 884625462 122394545 884625461
122394544 884625...

result:

ok OK

Test #11:

score: 0
Accepted
time: 3ms
memory: 3804kb

input:

2048
104790855 978585926
104790853 978585917
104790847 978585935
104790807 978585934
104790869 978585939
104790813 978585932
104790832 978585922
104790840 978585944
104790813 978585930
104790806 978585918
104790847 978585943
104790836 978585933
104790810 978585916
104790830 978585920
104790857 97858...

output:

Yes
104790869 978585945 104790870 978585944
104790869 978585943 104790870 978585942
104790869 978585941 104790870 978585940
104790869 978585939 104790870 978585938
104790869 978585937 104790870 978585936
104790869 978585935 104790870 978585934
104790869 978585933 104790870 978585932
104790869 978585...

result:

ok OK

Test #12:

score: 0
Accepted
time: 3ms
memory: 3716kb

input:

1000
378405767 3269747
378405743 3269785
378405740 3269786
378405763 3269757
378405763 3269781
378405765 3269757
378405742 3269768
378405767 3269751
378405763 3269741
378405738 3269730
378405749 3269739
378405745 3269733
378405745 3269759
378405764 3269778
378405741 3269729
378405759 3269755
3784057...

output:

Yes
378405769 3269785 378405771 3269783
378405769 3269781 378405771 3269779
378405769 3269777 378405771 3269775
378405769 3269773 378405771 3269771
378405769 3269769 378405771 3269767
378405769 3269765 378405771 3269763
378405769 3269761 378405771 3269759
378405769 3269757 378405771 3269755
37840576...

result:

ok OK

Test #13:

score: 0
Accepted
time: 2ms
memory: 3756kb

input:

100
11771 17392
11771 17393
11770 17393
11771 17394
11772 17392
11772 17393
11769 17393
11773 17393
11769 17392
11768 17392
11769 17394
11773 17392
11768 17391
11767 17391
11767 17392
11774 17393
11766 17391
11774 17392
11766 17390
11770 17394
11771 17395
11769 17391
11774 17391
11771 17396
11770 17...

output:

Yes
11777 17393 11778 17392
11777 17391 11778 17390
11776 17391 11778 17389
11775 17392 11776 17393
11775 17390 11776 17391
11775 17388 11776 17389
11774 17396 11775 17395
11774 17394 11775 17393
11774 17392 11775 17391
11774 17390 11775 17389
11773 17396 11775 17394
11773 17393 11774 17392
11773 17...

result:

ok OK

Test #14:

score: 0
Accepted
time: 2ms
memory: 3756kb

input:

410
380814730 2133815
380814730 2133814
380814729 2133814
380814731 2133814
380814731 2133815
380814731 2133816
380814729 2133813
380814732 2133816
380814730 2133816
380814728 2133814
380814732 2133817
380814731 2133813
380814732 2133813
380814732 2133812
380814728 2133815
380814733 2133816
38081473...

output:

Yes
380814743 2133809 380814744 2133810
380814742 2133810 380814743 2133809
380814741 2133818 380814742 2133819
380814741 2133816 380814742 2133817
380814741 2133812 380814743 2133814
380814741 2133808 380814743 2133810
380814740 2133818 380814741 2133817
380814740 2133816 380814741 2133815
38081474...

result:

ok OK

Test #15:

score: -100
Wrong Answer
time: 0ms
memory: 3856kb

input:

1106
31879487 28769582
31879486 28769582
31879487 28769581
31879486 28769581
31879486 28769583
31879487 28769583
31879487 28769580
31879488 28769580
31879488 28769583
31879485 28769582
31879488 28769579
31879485 28769583
31879488 28769582
31879486 28769580
31879486 28769584
31879486 28769585
3187948...

output:

Yes
31879508 28769578 31879513 28769573
31879507 28769578 31879508 28769577
31879507 28769576 31879509 28769574
31879507 28769573 31879510 28769570
31879506 28769578 31879507 28769577
31879506 28769576 31879508 28769574
31879506 28769573 31879507 28769572
31879505 28769577 31879506 28769578
31879505...

result:

wrong answer Not a square in query 405