QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#687767#692. Delete the Points0xyzWA 2ms3820kbC++141.4kb2024-10-29 21:06:462024-10-29 21:06:51

Judging History

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

  • [2024-10-29 21:06:51]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3820kb
  • [2024-10-29 21:06:46]
  • 提交

answer

#include<bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef pair<int,int> P;
int T=1,n;
set<P>s;
void ouc(P a,P b){
	cout<<b.F<<' '<<b.S<<' '<<b.F+max(a.F-b.F,b.S-a.S)<<' '<<b.S-max(a.F-b.F,b.S-a.S)<<'\n';
	s.erase(a);s.erase(b);
}
void oul(P a,P b){
	cout<<a.F<<' '<<a.S<<' '<<a.F+a.S-b.S<<' '<<b.S<<'\n';
	s.erase(a);s.erase(b); 
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	//cin>>T;
	while(T--){
		cin>>n;
		for(int i=1,x,y;i<=n;i++)cin>>x>>y,s.insert({x,y});
		cout<<"Yes\n";
		while(s.size()){
			set<P>::iterator p=s.end();
			P a,b,c;
			p--;a=*p;p--;b=*p;
			if(a.F==b.F)oul(a,b);
			else if(a.S>=b.S){
				cout<<b.F<<' '<<b.S<<' '<<b.F+max(a.F-b.F,a.S-b.S)<<' '<<b.S+max(a.F-b.F,a.S-b.S)<<'\n';
				s.erase(a);s.erase(b);
			}else if(s.size()==2)ouc(a,b);
			else{
				p--;c=*p;
				if(c.F!=b.F)ouc(a,b);
				else if(c.S<a.S){
					if(b.S-a.S>=a.F-b.F)ouc(a,b);
					else{
						cout<<"s"<<a.F<<'  '<<a.S<<' '<<b.F<<' '<<a.S+a.F-b.F<<'\n';
						s.erase(a);s.erase(b);
					}
				}else if(c.S>a.S)oul(b,c);
				else if(a.F-c.F>b.S-c.S)oul(b,c);
				else if(a.F-c.F<b.S-c.S){
					cout<<c.F<<' '<<c.S<<' '<<a.F<<' '<<c.S+a.F-c.F<<'\n';
					s.erase(a);s.erase(c);
				}else{
					cout<<b.F-1<<".5 "<<b.S<<' '<<b.F+b.S-c.S-1<<".5 "<<c.S<<'\n';
					s.erase(b);s.erase(c);
				}
			}
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 0ms
memory: 3668kb

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: 3592kb

input:

4
1 2
3 2
2 1
2 3

output:

Yes
2 3 3 2
1 2 2 1

result:

ok OK

Test #4:

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

input:

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

output:

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

result:

ok OK

Test #5:

score: 0
Accepted
time: 0ms
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 76 83 52
39 72 88 23
25 88 113 0
4 96 83 17
2 36 7 31

result:

ok OK

Test #6:

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

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 39 36 6

result:

ok OK

Test #7:

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

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 135791685 997371370 135791684
997371369 135791683 997371373 135791679
997371369 135791678 997371370 135791677
997371369 13...

result:

ok OK

Test #8:

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

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: 0ms
memory: 3612kb

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: 1ms
memory: 3740kb

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: 1ms
memory: 3752kb

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: 0ms
memory: 3644kb

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: 0ms
memory: 3720kb

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 17393 11776 17392
11775 17391 11776 17390
11775 17389 11776 17388
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: 1ms
memory: 3744kb

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 2133819 380814742 2133818
380814741 2133817 380814742 2133816
380814741 2133814 380814743 2133812
380814741 2133810 380814743 2133808
380814740 2133818 380814741 2133817
380814740 2133816 380814741 2133815
38081474...

result:

ok OK

Test #15:

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

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 28769578 31879506 28769577
31879505...

result:

ok OK

Test #16:

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

input:

1682
199151236 118971535
199151236 118971534
199151236 118971533
199151236 118971532
199151237 118971533
199151237 118971534
199151238 118971534
199151238 118971535
199151237 118971535
199151236 118971536
199151235 118971534
199151239 118971535
199151235 118971536
199151239 118971536
199151240 11897...

output:

Yes
199151266 118971542 199151267 118971541
199151265 118971543 199151266 118971542
199151264 118971542 199151265 118971541
199151264 118971532 199151269 118971527
199151264 118971526 199151265 118971525
199151263 118971541 199151264 118971540
199151263 118971532 199151264 118971531
199151263 118971...

result:

ok OK

Test #17:

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

input:

1120
66329602 172836461
66329603 172836461
66329604 172836461
66329604 172836460
66329603 172836460
66329602 172836462
66329601 172836462
66329602 172836460
66329602 172836459
66329601 172836461
66329601 172836460
66329602 172836463
66329600 172836461
66329603 172836463
66329603 172836459
66329603 1...

output:

Yes
66329624 172836462 66329625 172836461
66329623 172836463 66329624 172836462
66329622.5 172836461 66329623.5 172836460
66329623 172836459 66329624 172836460
66329622 172836462 66329623 172836461
66329622 172836459 66329623 172836458
66329621 172836474 66329622 172836473
66329621 172836463 6632962...

result:

ok OK

Test #18:

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

input:

2364
14502323 4917115
14502322 4917115
14502321 4917115
14502323 4917114
14502321 4917114
14502324 4917115
14502321 4917113
14502323 4917116
14502324 4917114
14502322 4917114
14502321 4917112
14502324 4917113
14502322 4917116
14502324 4917112
14502323 4917113
14502325 4917113
14502321 4917111
145023...

output:

Yes
14502347 4917114 14502348 4917113
14502346 4917114 14502347 4917113
14502346 4917112 14502353 4917105
14502346 4917101 14502347 4917100
14502345.5 4917099 14502346.5 4917098
14502345 4917121 14502351 4917115
14502345 4917114 14502346 4917113
14502345 4917111 14502347 4917109
14502345 4917108 145...

result:

ok OK

Test #19:

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

input:

1000
984711605 721217148
984711606 721217148
984711605 721217149
984711604 721217148
984711604 721217147
984711603 721217147
984711605 721217147
984711606 721217147
984711605 721217146
984711603 721217146
984711602 721217146
984711602 721217147
984711601 721217146
984711603 721217148
984711606 72121...

output:

Yes
984711625 721217154 984711626 721217155
984711625 721217153 984711631 721217147
984711624 721217156 984711625 721217155
984711624 721217154 984711625 721217153
984711624 721217152 984711627 721217149
984711624 721217148 984711625 721217147
984711623 721217156 984711624 721217155
984711623 721217...

result:

ok OK

Test #20:

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

input:

2000
843557823 928504418
843557822 928504418
843557823 928504417
843557823 928504416
843557824 928504417
843557822 928504419
843557823 928504415
843557823 928504414
843557824 928504414
843557824 928504413
843557821 928504419
843557824 928504415
843557823 928504413
843557822 928504417
843557822 92850...

output:

Yes
843557847 928504417 843557857 928504407
843557846 928504425 843557852 928504419
843557846 928504418 843557847 928504417
843557846 928504415 843557850 928504411
843557846 928504407 843557847 928504406
843557845 928504425 843557846 928504424
843557845 928504423 843557846 928504422
843557845 928504...

result:

ok OK

Test #21:

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

input:

3000
326952474 119559920
326952475 119559920
326952474 119559921
326952475 119559919
326952474 119559922
326952473 119559921
326952475 119559921
326952476 119559920
326952474 119559919
326952473 119559922
326952475 119559922
326952476 119559922
326952473 119559919
326952476 119559919
326952473 11955...

output:

Yes
326952513 119559903 326952514 119559902
326952513 119559901 326952514 119559902
326952512 119559902 326952513 119559901
326952511 119559904 326952512 119559903
326952509.5 119559903 326952510.5 119559902
326952510 119559901 326952511 119559902
326952509 119559907 326952513 119559903
326952509 11...

result:

ok OK

Test #22:

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

input:

3000
380232772 174172185
380232771 174172185
380232772 174172184
380232771 174172184
380232771 174172186
380232773 174172185
380232770 174172186
380232773 174172184
380232769 174172186
380232772 174172186
380232774 174172184
380232774 174172185
380232770 174172184
380232774 174172186
380232769 17417...

output:

Yes
380232809 174172188 380232810 174172187
380232808 174172187 380232812 174172183
380232807.5 174172179 380232808.5 174172178
380232808 174172177 380232809 174172178
380232807 174172188 380232808 174172187
380232807 174172186 380232809 174172184
380232807 174172183 380232811 174172179
380232806 17...

result:

ok OK

Test #23:

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

input:

3000
140198268 469838596
140198268 469838597
140198267 469838597
140198267 469838596
140198267 469838595
140198268 469838595
140198269 469838595
140198267 469838594
140198267 469838593
140198266 469838593
140198268 469838594
140198266 469838592
140198270 469838595
140198269 469838594
140198269 46983...

output:

Yes
140198312 469838596 140198313 469838595
140198310 469838596 140198311 469838597
140198309 469838598 140198310 469838597
140198308 469838601 140198310 469838599
140198308 469838596 140198309 469838597
140198307 469838602 140198308 469838601
140198306.5 469838599 140198307.5 469838598
140198307 46...

result:

ok OK

Test #24:

score: -100
Wrong Answer
time: 2ms
memory: 3744kb

input:

3000
901816252 637962925
901816253 637962925
901816251 637962925
901816253 637962924
901816252 637962926
901816253 637962926
901816254 637962924
901816253 637962923
901816255 637962924
901816254 637962923
901816252 637962924
901816250 637962925
901816255 637962923
901816256 637962924
901816249 63796...

output:

Yes
901816292 637962926 901816293 637962925
901816291 637962926 901816292 637962925
901816290 637962928 901816291 637962927
901816290 637962926 901816291 637962925
901816290 637962924 901816291 637962925
901816289 637962931 901816290 637962930
901816289 637962925 901816290 637962924
901816289 637962...

result:

wrong answer Expected double but found NAN.