QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#548067#9177. String and Nailsparamec1um#AC ✓55ms8408kbC++20777b2024-09-05 15:06:492024-09-05 15:06:50

Judging History

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

  • [2024-09-05 15:06:50]
  • 评测
  • 测评结果:AC
  • 用时:55ms
  • 内存:8408kb
  • [2024-09-05 15:06:49]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define IN inline
typedef long long ll;
const int maxn=2e5+10;
struct Point{
    ll 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排序
    }
}a[maxn];
ostream & operator<<(ostream &out,const Point &t){out<<t.x<<' '<<t.y;return out;}
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;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 8392kb

input:

3
1 1
2 4
3 1

output:

YES
3 1
1 1

result:

ok Everything ok

Test #2:

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

input:

1
1000000000 0

output:

YES

result:

ok Everything ok

Test #3:

score: 0
Accepted
time: 47ms
memory: 8276kb

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
548557791 444328954
548837545 444572963
548313782 444608708
549117299 444816972
548593536 444852717
548069773 444888462
549397053 445060981
548873290 445096726
548349527 445132471
547825764 445168216
549676807 445304990
549153044 445340735
548629281 445376480
548105518 445412225
547581755 445447...

result:

ok Everything ok

Test #4:

score: 0
Accepted
time: 48ms
memory: 8332kb

input:

200000
500000000 500000000
500222156 499645622
500444312 499291244
500666468 498936866
500888624 498582488
501110780 498228110
501332936 497873732
501555092 497519354
501777248 497164976
501999404 496810598
502221560 496456220
502443716 496101842
502665872 495747464
502888028 495393086
503110184 495...

output:

YES
544209044 429478778
544563422 429700934
543986888 429833156
544917800 429923090
544341266 430055312
545272178 430145246
543764732 430187534
544695644 430277468
545626556 430367402
544119110 430409690
545050022 430499624
543542576 430541912
545980934 430589558
544473488 430631846
545404400 430721...

result:

ok Everything ok

Test #5:

score: 0
Accepted
time: 52ms
memory: 8312kb

input:

200000
500000000 500000000
500000000 499720246
500000000 499440492
500000000 499160738
500000000 498880984
500000000 498601230
500000000 498321476
500000000 498041722
500000000 497761968
500000000 497482214
500000000 497202460
500000000 496922706
500000000 496642952
500000000 496363198
500000000 496...

output:

YES
779474246 444328954
779194492 444328954
778914738 444328954
778634984 444328954
778355230 444328954
778075476 444328954
777795722 444328954
777515968 444328954
777236214 444328954
776956460 444328954
776676706 444328954
776396952 444328954
776117198 444328954
775837444 444328954
775557690 444328...

result:

ok Everything ok

Test #6:

score: 0
Accepted
time: 31ms
memory: 8256kb

input:

200000
500000000 500000000
500040773 499984682
500081546 499969364
500122319 499954046
500163092 499938728
500203865 499923410
500244638 499908092
500285411 499892774
500326184 499877456
500366957 499862138
500407730 499846820
500448503 499831502
500489276 499816184
500530049 499800866
500570822 499...

output:

YES
500774687 499708958
500733914 499724276
500693141 499739594
500790005 499749731
500652368 499754912
500749232 499765049
500611595 499770230
500708459 499780367
500570822 499785548
500805323 499790504
500667686 499795685
500530049 499800866
500764550 499805822
500626913 499811003
500489276 499816...

result:

ok Everything ok

Test #7:

score: 0
Accepted
time: 41ms
memory: 8340kb

input:

200000
500000000 500000000
500003221 499984460
500006442 499968920
500009663 499953380
500012884 499937840
500016105 499922300
500019326 499906760
500022547 499891220
500025768 499875680
500028989 499860140
500032210 499844600
500035431 499829060
500038652 499813520
500041873 499797980
500045094 499...

output:

YES
564416779 189215540
564432319 189218761
564447859 189221982
564463399 189225203
564478939 189228424
564413558 189231080
564494479 189231645
564429098 189234301
564510019 189234866
564444638 189237522
564525559 189238087
564460178 189240743
564541099 189241308
564475718 189243964
564556639 189244...

result:

ok Everything ok

Test #8:

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

input:

100
29 58
10 60
7 34
47 47
48 29
37 25
30 42
47 32
60 28
0 2
53 1
42 32
3 34
52 24
45 7
32 60
40 1
15 22
60 43
17 19
17 54
24 22
21 38
37 26
11 46
18 59
27 18
11 19
34 14
8 16
50 38
29 10
34 59
5 28
14 36
34 41
57 53
25 8
17 0
35 5
60 52
36 10
38 8
50 41
38 18
45 39
44 16
33 21
18 19
51 25
35 58
49 ...

output:

YES
49 0
17 0
53 1
40 1
0 2
27 4
17 4
35 5
60 6
45 7
28 7
38 8
25 8
0 9
36 10
29 10
52 12
56 13
34 13
1 13
34 14
9 14
52 16
44 16
8 16
8 17
38 18
27 18
20 19
18 19
17 19
11 19
3 20
33 21
24 22
15 22
2 22
16 23
52 24
1 24
51 25
37 25
2 25
37 26
16 26
60 28
49 28
30 28
5 28
48 29
43 30
19 30
21 31
18 ...

result:

ok Everything ok

Test #9:

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

input:

100
42 46
57 9
21 58
30 46
43 25
43 31
15 28
33 8
31 28
48 26
47 54
57 13
33 11
4 1
5 0
28 45
4 10
9 56
54 49
6 20
49 22
33 43
31 15
42 56
51 15
3 29
46 23
22 29
49 50
16 20
60 48
41 16
42 53
14 41
17 45
31 6
50 19
6 0
57 50
36 40
29 34
0 33
52 59
17 7
37 23
20 31
8 14
56 28
2 53
44 3
54 18
22 59
53...

output:

YES
32 0
6 0
5 0
45 1
23 1
4 1
2 1
44 3
49 4
36 4
31 6
51 7
38 7
17 7
33 8
57 9
11 9
4 9
22 10
10 10
4 10
60 11
33 11
36 12
57 13
36 14
8 14
51 15
31 15
59 16
41 16
20 16
12 17
57 18
54 18
10 18
50 19
7 19
36 20
16 20
6 20
30 21
10 21
49 22
46 23
37 23
43 25
53 26
48 26
56 28
31 28
15 28
22 29
12 29...

result:

ok Everything ok

Test #10:

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

input:

100
47 30
32 14
26 29
13 41
45 17
42 34
56 2
11 57
11 28
39 0
40 47
19 43
59 57
21 39
33 45
16 17
17 22
60 42
39 55
52 18
28 48
42 6
44 48
56 29
26 40
41 31
43 40
24 32
9 44
41 23
30 5
30 36
36 35
22 12
6 46
57 44
9 21
25 29
3 0
18 26
25 35
29 50
23 42
43 15
58 49
37 10
42 30
8 40
6 18
8 27
30 44
47...

output:

YES
39 0
9 0
3 0
12 1
56 2
59 3
51 4
8 4
33 5
30 5
42 6
22 6
58 7
13 8
37 10
22 12
26 13
44 14
32 14
48 15
44 15
43 15
27 15
19 16
45 17
16 17
52 18
6 18
56 19
9 21
17 22
2 22
41 23
27 24
18 26
41 27
8 27
51 28
11 28
56 29
34 29
26 29
25 29
47 30
44 30
42 30
53 31
41 31
24 32
8 32
42 34
36 35
25 35
...

result:

ok Everything ok

Test #11:

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

input:

100
60 19
19 20
36 57
54 36
40 17
45 45
32 49
58 41
47 28
26 28
38 48
39 24
24 43
30 8
53 45
12 2
35 30
54 19
33 0
36 24
60 8
2 27
1 25
0 59
13 13
47 52
22 60
6 36
54 51
25 8
52 51
57 9
39 45
51 41
6 51
32 43
52 40
57 39
4 4
36 6
9 18
21 13
50 1
50 33
38 29
31 53
47 37
56 45
53 21
13 34
1 23
42 18
3...

output:

YES
48 0
33 0
50 1
44 1
29 1
48 2
12 2
53 3
49 4
4 4
31 5
43 6
36 6
35 7
30 7
60 8
30 8
25 8
57 9
21 13
13 13
54 15
31 15
12 15
43 17
40 17
57 18
42 18
9 18
60 19
54 19
19 20
57 21
53 21
1 23
39 24
36 24
1 25
2 27
47 28
26 28
15 28
12 28
38 29
35 30
46 32
5 32
60 33
50 33
36 33
54 34
21 34
13 34
29 ...

result:

ok Everything ok

Test #12:

score: 0
Accepted
time: 45ms
memory: 8308kb

input:

200000
658 517
723 846
391 133
564 468
633 202
556 954
760 456
151 969
436 184
984 490
896 355
871 985
101 474
136 92
220 747
833 272
839 145
783 485
78 888
819 829
177 209
233 546
709 414
105 273
955 945
748 593
182 181
160 645
532 327
491 354
512 24
190 152
147 539
476 300
474 289
478 772
157 853
...

output:

YES
999 0
995 0
994 0
993 0
989 0
987 0
986 0
969 0
965 0
959 0
957 0
952 0
951 0
944 0
941 0
935 0
929 0
924 0
922 0
919 0
915 0
897 0
883 0
882 0
866 0
864 0
861 0
854 0
851 0
839 0
831 0
830 0
828 0
821 0
820 0
819 0
811 0
809 0
801 0
800 0
783 0
781 0
780 0
768 0
764 0
761 0
757 0
749 0
745 0
73...

result:

ok Everything ok

Test #13:

score: 0
Accepted
time: 45ms
memory: 8260kb

input:

200000
378 842
689 0
407 360
925 706
35 241
517 296
157 365
379 630
234 828
370 628
28 136
367 483
546 638
995 367
901 983
479 253
812 610
454 878
250 0
618 535
221 325
346 583
470 440
997 887
197 643
613 711
687 194
468 519
837 984
844 159
220 857
101 701
120 531
391 802
361 11
519 944
370 285
766 ...

output:

YES
991 0
985 0
984 0
975 0
970 0
968 0
955 0
943 0
941 0
936 0
932 0
931 0
930 0
926 0
913 0
904 0
892 0
891 0
879 0
877 0
874 0
873 0
866 0
862 0
859 0
857 0
843 0
831 0
828 0
827 0
814 0
798 0
796 0
791 0
790 0
789 0
784 0
783 0
777 0
760 0
756 0
754 0
753 0
743 0
741 0
738 0
736 0
735 0
734 0
73...

result:

ok Everything ok

Test #14:

score: 0
Accepted
time: 45ms
memory: 8248kb

input:

200000
860 546
26 774
422 975
277 563
812 661
98 259
937 887
599 299
41 472
376 385
154 919
855 361
229 191
472 22
572 217
506 227
15 75
116 501
803 733
799 860
893 53
459 238
223 848
127 889
821 952
105 439
182 960
529 12
761 640
824 576
920 681
631 241
85 531
314 542
240 734
933 124
972 710
593 79...

output:

YES
997 0
989 0
987 0
977 0
971 0
969 0
967 0
966 0
953 0
946 0
944 0
934 0
929 0
925 0
920 0
914 0
910 0
898 0
888 0
879 0
876 0
874 0
871 0
869 0
866 0
863 0
858 0
856 0
850 0
833 0
831 0
829 0
828 0
827 0
825 0
816 0
804 0
801 0
789 0
788 0
781 0
773 0
769 0
763 0
761 0
756 0
753 0
749 0
742 0
73...

result:

ok Everything ok

Test #15:

score: 0
Accepted
time: 52ms
memory: 8344kb

input:

200000
824175840 488750041
893673855 438646868
506562578 184637200
761446161 4953165
923499503 652902113
817153029 230202371
946810300 303530617
906604390 328096095
697686565 540398115
228789229 425571938
208244496 326466740
966638889 820582012
90257817 655318977
216563076 98765025
574316317 6924138...

output:

YES
65049522 13385
355769547 13484
632455603 14646
904988161 20217
82943885 21978
40991399 27924
184602586 31177
142623119 39066
358852743 41781
455146543 53629
80745665 61065
825569985 63147
283406997 67995
672872038 88340
811725475 90906
186086040 91053
327658599 100133
193045739 113412
947668478 ...

result:

ok Everything ok

Test #16:

score: 0
Accepted
time: 52ms
memory: 8384kb

input:

200000
1433020 626069928
229180372 161196849
900502139 7107082
972307164 933305447
771737287 191739450
323730061 8183918
949678944 490542724
523994382 985258262
953870673 374422949
96559137 217074405
627267233 174567394
573638149 400359707
141414987 321531687
809839237 701887439
316867805 708592231
...

output:

YES
593024680 1744
802092207 3683
23433013 11477
502926810 16021
451542217 18424
628606567 24469
723625873 32109
97185208 42576
859676938 55938
196653493 58669
22359228 59463
16806070 60407
56389828 64110
344766143 64260
812340398 71806
293374934 71996
274696243 80328
347383063 81578
294175718 84439...

result:

ok Everything ok

Test #17:

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

input:

5
0 1000000000
1000000000 0
0 0
1000000000 1000000000
500000000 500000000

output:

YES
1000000000 0
0 0
500000000 500000000
1000000000 1000000000

result:

ok Everything ok

Test #18:

score: 0
Accepted
time: 48ms
memory: 8312kb

input:

200000
178690201 763389816
228250401 473681415
925845481 534609673
814571948 566690436
30040488 435609496
125274385 81132757
247514879 898893195
67755446 273824208
841458560 282076711
669361754 713609582
46289970 432733465
107008482 685170111
487539449 987744399
108148105 83671488
722982805 72477062...

output:

YES
227206566 881
273148842 978
783416266 1723
246937964 8594
331666913 14988
4293846 15352
33761525 16955
510527703 19086
173647365 24144
109529835 24665
100139447 38388
459914683 51097
17655547 51649
879627852 61534
781158537 64189
207600912 65717
701984436 67377
146620611 67874
265254933 87470
34...

result:

ok Everything ok

Test #19:

score: 0
Accepted
time: 44ms
memory: 8340kb

input:

200000
60980090 900709703
858724210 491198688
319785041 430708482
25432950 790010009
878278273 384512251
926818709 490518084
176754595 380872594
685145439 562390155
24013739 116101546
537131662 136515830
833908927 617270608
8975034 264947807
833663911 990393598
406456974 391826610
170567002 74094902...

output:

YES
773469169 6012
235120196 7071
1359407 7560
218807049 15901
222374947 16557
583225659 19374
939058868 21756
869093910 23831
638904676 25186
50468751 29069
949586293 31698
921423056 43822
768521503 45032
328920534 46148
271890381 50484
587833173 53970
877332156 60016
351882821 62793
190960107 6592...

result:

ok Everything ok

Test #20:

score: 0
Accepted
time: 48ms
memory: 8332kb

input:

200000
943269980 38029589
857794239 582344890
713724603 253178364
572730442 718362290
726516058 923349589
728363033 563466923
179623240 789223065
933939212 555988811
575165138 655159089
404901571 633051007
957964373 170403969
910941587 918354431
884821081 656606308
999733135 363545243
281714710 9784...

output:

YES
523450275 1683
131733883 6291
314225416 7395
815193713 8973
274468243 11187
431821643 13027
673413922 31261
776597502 32142
475055020 36647
357299460 41020
30723861 44353
26547652 56175
35575103 62578
457097283 86913
858183009 90045
158287148 91139
71479668 96003
77558342 96527
646332703 113981
...

result:

ok Everything ok

Test #21:

score: 0
Accepted
time: 44ms
memory: 8408kb

input:

200000
415494452 470316769
193300756 599862164
34035236 780680955
709962518 351747279
279786550 167219634
529907356 46481178
477459176 271202463
182732984 844554758
757720317 857780143
977704188 129586183
376987109 723537332
107875431 498132126
230945542 322819018
298042004 376733073
319233490 99464...

output:

YES
403587421 1109
501623175 1304
856612756 6929
492016237 6946
602486440 9539
902342475 14605
554567652 18744
58451787 19583
855415198 22470
481684776 42757
300662832 42804
589432557 45412
56622465 49548
379732466 54361
597930050 56933
651583674 70582
738158026 72499
852788332 75536
538763186 77326...

result:

ok Everything ok

Test #22:

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

input:

100
500000000 500000000
500000000 489443908
500000000 478887816
500000000 468331724
500000000 457775632
500000000 447219540
500000000 436663448
500000000 426107356
500000000 415551264
500000000 404995172
510556092 500000000
510556092 489443908
510556092 478887816
510556092 468331724
510556092 457775...

output:

YES
595004828 404995172
584448736 404995172
573892644 404995172
563336552 404995172
552780460 404995172
542224368 404995172
531668276 404995172
521112184 404995172
510556092 404995172
500000000 404995172
595004828 415551264
584448736 415551264
573892644 415551264
563336552 415551264
552780460 415551...

result:

ok Everything ok

Test #23:

score: 0
Accepted
time: 55ms
memory: 8328kb

input:

200000
571121104 497369632
424233472 502802176
635651583 494983014
459708961 501490138
627796261 495273538
615283564 495736312
535668814 498680812
639758509 494831122
592923243 496563294
523187049 499142442
426839493 502705794
378712816 504485728
394223105 503912090
581741325 496976850
619310348 495...

output:

YES
640600000 494800000
640599297 494800026
640597891 494800078
640594376 494800208
640592267 494800286
640588049 494800442
640587346 494800468
640586643 494800494
640584534 494800572
640583128 494800624
640581722 494800676
640581019 494800702
640580316 494800728
640579613 494800754
640578910 494800...

result:

ok Everything ok

Extra Test:

score: 0
Extra Test Passed