QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#544281 | #9177. String and Nails | gzchenben# | AC ✓ | 64ms | 4760kb | C++14 | 620b | 2024-09-02 14:28:03 | 2024-09-02 14:28:03 |
Judging History
answer
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int n;
pair<long long, long long> pos[200005];
int main() {
scanf("%d", &n);
for (int i = 1;i <= n;i++) {
scanf("%lld%lld", &pos[i].first, &pos[i].second);
}
sort(pos + 1, pos + n + 1, [](pair<long long, long long> x, pair<long long, long long> y) {
return x.first * x.first + x.second * x.second > y.first * y.first + y.second * y.second;
});
printf("YES\n");
for (int i = 1;i < n;i++) {
printf("%lld %lld\n", pos[i].first, pos[i].second);
}
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 1540kb
input:
3 1 1 2 4 3 1
output:
YES 2 4 3 1
result:
ok Everything ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 1572kb
input:
1 1000000000 0
output:
YES
result:
ok Everything ok
Test #3:
score: 0
Accepted
time: 49ms
memory: 4652kb
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 779474246 743764991 779718255 743485237 779962264 743205483 780206273 742925729 780450282 742645975 780694291 742366221 780938300 742086467 781182309 741806713 781426318 741526959 781670327 741247205 781914336 740967451 782158345 740687697 782402354 740407943 782646363 740128189 782890372 739848...
result:
ok Everything ok
Test #4:
score: 0
Accepted
time: 39ms
memory: 4668kb
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 854023622 721933844 854245778 721579466 854467934 721225088 854690090 720870710 854912246 720516332 855134402 720161954 855356558 719807576 855578714 719453198 853669244 721711688 855800870 719098820 853891400 721357310 856023026 718744442 854113556 721002932 856245182 718390064 854335712 720648...
result:
ok Everything ok
Test #5:
score: 0
Accepted
time: 42ms
memory: 4708kb
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 500000000 779474246 499720246 779194492 500000000 779474246 499440492 779194492 499720246 779474246 499160738 778914738 500000000 779194492 499440492 779474246 498880984 778914738 499720246 779194492 499160738 778634984 500000000 779474246 498601230 778914738 499440492 779194492 498880...
result:
ok Everything ok
Test #6:
score: 0
Accepted
time: 48ms
memory: 4660kb
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 653939369 907398185 653898596 907413503 653857823 907428821 653817050 907444139 653924051 907357412 653776277 907459457 653883278 907372730 653735504 907474775 653842505 907388048 653694731 907490093 653801732 907403366 653653958 907505411 653908733 907316639 653760959 907418684 653613185 907520...
result:
ok Everything ok
Test #7:
score: 0
Accepted
time: 50ms
memory: 4704kb
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 500139860 500028989 500143081 500013449 500124320 500025768 500146302 499997909 500127541 500010228 500149523 499982369 500108780 500022547 500130762 499994688 500152744 499966829 500112001 500007007 500133983 499979148 500093240 500019326 500155965 499951289 500115222 499991467 500137204 499963...
result:
ok Everything ok
Test #8:
score: 0
Accepted
time: 0ms
memory: 1652kb
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 54 60 60 52 50 60 57 53 60 43 56 48 44 57 57 38 34 59 32 60 35 58 47 47 60 28 53 38 29 58 50 41 46 45 52 36 50 38 18 59 10 60 60 6 45 39 56 13 52 24 18 54 47 32 51 25 17 54 49 28 48 29 24 50 25 49 52 16 52 12 34 41 53 1 20 49 42 32 43 30 2 52 17 49 30 42 16 49 37 35 30 40 49 0 35 32 11 46 44 16 ...
result:
ok Everything ok
Test #9:
score: 0
Accepted
time: 0ms
memory: 1604kb
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 55 57 52 59 60 48 57 50 54 49 47 54 48 52 51 48 49 50 42 56 42 53 47 48 57 32 23 60 22 59 44 45 56 28 42 46 21 58 59 16 60 11 57 18 53 26 57 13 57 9 54 18 36 44 9 56 24 51 44 34 30 46 48 26 33 43 35 41 36 40 49 22 50 19 16 51 51 15 2 53 43 31 28 45 14 51 51 7 46 23 43 25 49 4 17 45 13 46 2 47 29...
result:
ok Everything ok
Test #10:
score: 0
Accepted
time: 0ms
memory: 1620kb
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 60 56 59 57 58 49 45 60 53 52 60 42 57 44 38 57 39 55 46 48 47 47 30 59 28 59 44 48 56 29 40 47 53 31 49 36 16 58 26 54 56 19 59 3 43 40 42 41 9 58 58 7 51 28 38 44 11 57 29 50 12 56 19 54 31 47 35 44 56 2 33 45 47 30 28 48 7 55 52 18 11 53 42 34 28 46 30 44 44 30 15 51 17 50 42 30 41 31 51 4 48...
result:
ok Everything ok
Test #11:
score: 0
Accepted
time: 0ms
memory: 1636kb
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 60 50 55 55 53 53 54 51 52 51 56 45 58 41 47 52 53 45 38 58 57 39 60 33 36 57 55 38 32 58 52 40 51 41 54 36 22 60 54 34 45 45 60 19 31 53 38 48 16 59 36 49 57 21 60 8 40 45 50 33 47 37 57 18 39 45 0 59 32 49 16 56 57 9 19 54 54 19 53 21 54 15 46 32 42 37 47 28 12 53 32 43 53 3 34 39 6 51 50 1 24...
result:
ok Everything ok
Test #12:
score: 0
Accepted
time: 42ms
memory: 4760kb
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 998 1000 1000 995 999 992 994 997 992 998 995 995 990 999 991 998 1000 988 989 999 998 990 991 996 995 992 999 987 997 989 990 996 1000 985 985 1000 999 986 998 987 996 989 989 996 991 994 992 993 996 988 990 994 991 993 997 986 983 999 986 996 988 994 992 990 991 991 983 998 995 986 986 995 991...
result:
ok Everything ok
Test #13:
score: 0
Accepted
time: 48ms
memory: 4660kb
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 998 1000 997 1000 995 1000 999 995 995 999 993 1000 1000 993 994 999 997 996 999 993 995 997 991 1000 992 999 998 993 997 994 991 999 993 997 996 994 989 1000 998 991 992 997 990 998 991 997 995 993 999 988 998 989 989 998 993 994 996 990 997 988 989 996 994 991 986 998 987 997 999 984 985 998 9...
result:
ok Everything ok
Test #14:
score: 0
Accepted
time: 48ms
memory: 4712kb
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 1000 998 998 1000 1000 997 1000 996 996 998 998 995 1000 991 997 994 991 999 1000 989 990 999 991 998 998 991 997 992 993 996 998 990 991 997 999 988 998 989 994 993 993 994 999 987 985 1000 993 992 998 986 989 995 984 999 998 985 997 986 993 990 992 991 998 984 995 987 988 994 981 1000 982 999 ...
result:
ok Everything ok
Test #15:
score: 0
Accepted
time: 53ms
memory: 4716kb
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 999858751 999444958 999154527 994944926 999183009 994734797 996365836 996882427 998006369 994764079 994513919 998171809 992645679 999792581 995150253 996024789 996453709 994650856 993612798 997320359 994281312 995841014 994837147 994823676 991242566 997984329 989483500 998151028 998120598 989108...
result:
ok Everything ok
Test #16:
score: 0
Accepted
time: 55ms
memory: 4660kb
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 996897953 998869079 999672121 996004706 999920881 995386001 999849365 994173194 997106793 996175939 994947101 997968275 992448622 997513410 991410674 998434523 995764373 993885923 992761400 996576681 991148788 997909543 999538536 988840498 994942397 992906503 994074201 993222633 992310933 994320...
result:
ok Everything ok
Test #17:
score: 0
Accepted
time: 0ms
memory: 1540kb
input:
5 0 1000000000 1000000000 0 0 0 1000000000 1000000000 500000000 500000000
output:
YES 1000000000 1000000000 0 1000000000 1000000000 0 500000000 500000000
result:
ok Everything ok
Test #18:
score: 0
Accepted
time: 64ms
memory: 4656kb
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 998787042 999655205 995058672 999559819 995952493 998156155 998105792 995708381 998049292 993906374 997271960 994141515 992290794 998954309 999506706 991580983 998009186 991974143 989511883 999891293 999594134 989553067 998306545 990159979 993122950 995212865 997769122 990535968 996313881 991792...
result:
ok Everything ok
Test #19:
score: 0
Accepted
time: 57ms
memory: 4668kb
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 997388441 999226773 995084768 997837650 995987382 996608709 996270200 995804881 995944982 996051261 999515086 992099845 996934566 991960337 992601358 996021675 988775399 999574863 992844110 995505588 998164987 990129296 995162368 992445048 999178752 986355055 991458035 994049645 998848928 986613...
result:
ok Everything ok
Test #20:
score: 0
Accepted
time: 59ms
memory: 4748kb
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 997228506 998843267 996393309 997839505 995609087 998581076 999194847 994860566 999416492 994595423 997199186 996746608 996269596 996146433 993253988 998145676 998671777 992252009 990909391 999687018 991515494 998369853 990850889 998981353 998869235 990737468 992245582 997307543 990083917 999373...
result:
ok Everything ok
Test #21:
score: 0
Accepted
time: 56ms
memory: 4728kb
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 998683222 997025857 997528744 996699928 992913880 999656572 995503878 996509618 998581356 993270822 991840711 999829716 993167702 998145502 991005630 999785510 994821840 995153168 995522044 994387292 997732558 992046033 991022067 998098279 995162491 992499892 992321491 995140084 990567498 996822...
result:
ok Everything ok
Test #22:
score: 0
Accepted
time: 0ms
memory: 1548kb
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 500000000 595004828 489443908 584448736 500000000 595004828 478887816 584448736 489443908 573892644 500000000 595004828 468331724 584448736 478887816 573892644 489443908 563336552 500000000 595004828 457775632 584448736 468331724 573892644 478887816 563336552 489443908 552780460 500000...
result:
ok Everything ok
Test #23:
score: 0
Accepted
time: 59ms
memory: 4712kb
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