QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#65606 | #3043. Lexicographically Minimum Walk | gyh20 | AC ✓ | 101ms | 22624kb | C++14 | 833b | 2022-12-02 11:55:44 | 2022-12-02 11:55:47 |
Judging History
answer
#include<bits/stdc++.h>
#define re register
using namespace std;
inline int read(){
re int t=0;re char v=getchar();
while(v<'0')v=getchar();
while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
return t;
}
int n,m,S,T,A[300002],B[300002],C[300002],mn[300002];
char v[300002];
vector<int>G[300002];
inline void dfs(re int x){
v[x]=1;
for(auto z:G[x])if(!v[z])dfs(z);
}
int main(){
n=read(),m=read(),S=read(),T=read(),C[0]=2e9;
for(re int i=1;i<=m;++i)A[i]=read(),B[i]=read(),C[i]=read(),G[B[i]].push_back(A[i]);
dfs(T);if(!v[S])return puts("IMPOSSIBLE"),0;
for(re int i=1;i<=m;++i)if(v[B[i]]&&C[i]<C[mn[A[i]]])mn[A[i]]=i;
int pos=S;vector<int>tmp;
while(tmp.size()<1000000&&pos^T)tmp.push_back(C[mn[pos]]),pos=B[mn[pos]];
if(tmp.size()>=1000000)puts("TOO LONG");
else for(auto z:tmp)printf("%d ",z);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 12848kb
input:
3 3 1 3 1 2 1 2 3 7 1 3 5
output:
1 7
result:
ok single line: '1 7 '
Test #2:
score: 0
Accepted
time: 9ms
memory: 14300kb
input:
3 4 1 3 1 2 1 2 1 2 2 3 7 1 3 5
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #3:
score: 0
Accepted
time: 2ms
memory: 10392kb
input:
2 0 2 1
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #4:
score: 0
Accepted
time: 6ms
memory: 10632kb
input:
4 4 1 4 1 2 3 2 3 1 3 1 6 3 4 5
output:
3 1 5
result:
ok single line: '3 1 5 '
Test #5:
score: 0
Accepted
time: 2ms
memory: 11448kb
input:
2 1 2 1 2 1 7
output:
7
result:
ok single line: '7 '
Test #6:
score: 0
Accepted
time: 6ms
memory: 10564kb
input:
2 2 1 2 1 2 2 2 1 1
output:
2
result:
ok single line: '2 '
Test #7:
score: 0
Accepted
time: 12ms
memory: 12852kb
input:
28859 86572 9295 11138 20786 10116 517787813 15575 14210 496341115 3830 4061 197006194 17520 5640 491762666 5140 21769 335255632 1656 6657 593849630 22703 267 432722157 24447 19519 787542727 19699 8688 505772317 1872 4189 209599628 12873 21023 303869213 16428 25691 369100452 24666 22655 490450477 69...
output:
276564833 747181428 245358434 243885332 117499601 619812353 284290651 299304374 902348522 88409440 269505876 35537697 270772809 386354731 507174655 86955126 25262475 233484277 978898295 176709567 234217699 53693224 853405827 538248861 841660562 239847518 347254527 81719421 326831893 336594724 242183...
result:
ok single line: '276564833 747181428 245358434 ... 105378754 437440589 546992718 '
Test #8:
score: 0
Accepted
time: 2ms
memory: 10664kb
input:
11 19 7 2 7 2 28748732 7 6 797829355 9 2 160449218 3 8 378994618 6 1 138996221 8 3 840594328 7 5 818008580 1 8 954291757 2 1 556259670 7 10 290688600 4 9 706926230 5 9 164163676 1 4 782177068 11 6 789301711 11 3 389872647 3 5 69356287 3 4 743988075 8 10 155374934 7 11 404011431
output:
28748732
result:
ok single line: '28748732 '
Test #9:
score: 0
Accepted
time: 6ms
memory: 10592kb
input:
9 15 1 6 6 7 462224593 2 3 743144908 7 6 789301711 3 8 384836991 8 1 290688600 4 8 378994618 7 5 576823355 1 9 839296263 6 4 902236202 5 2 191890310 1 6 492601449 4 3 125660016 7 9 28748732 9 2 69356287 2 4 650287940
output:
492601449
result:
ok single line: '492601449 '
Test #10:
score: 0
Accepted
time: 8ms
memory: 14172kb
input:
100 157 54 89 89 73 293931814 63 14 209896431 5 30 191699654 66 70 392042756 96 61 941158190 99 58 444754263 27 55 71758606 19 15 731546581 88 5 700175183 99 2 179330504 51 77 35043830 6 31 116721425 77 39 948580482 16 36 226667776 61 89 131822429 12 26 476717409 4 46 885401404 66 72 861769143 12 3 ...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #11:
score: 0
Accepted
time: 6ms
memory: 10524kb
input:
100 157 16 14 59 29 163840668 41 35 648002202 88 37 126484862 39 90 780916575 60 53 61164523 54 25 922434669 67 94 303668358 51 74 351045720 89 34 493183208 76 93 203312810 14 54 1847679 61 34 619782776 43 33 925789638 37 63 35291187 60 56 465863799 8 26 830369370 36 96 71285293 34 27 510401935 40 3...
output:
35043830 748071459 24317015 157390034 493183208 510401935 254961810 339729821 479242650 25948429 883836319 433768447 545560104 303668358 417219069 578686766 739981933 591982401 362175448
result:
ok single line: '35043830 748071459 24317015 15... 739981933 591982401 362175448 '
Test #12:
score: 0
Accepted
time: 5ms
memory: 10568kb
input:
100 157 16 92 59 29 163840668 41 35 648002202 88 37 126484862 39 90 780916575 60 53 61164523 54 25 922434669 67 94 303668358 51 74 351045720 89 34 493183208 76 93 203312810 14 54 1847679 61 34 619782776 43 33 925789638 37 63 35291187 60 56 465863799 8 26 830369370 36 96 71285293 34 27 510401935 40 3...
output:
35043830 748071459 24317015 157390034 493183208 510401935 254961810 339729821 479242650 25948429 883836319 433768447 545560104 303668358 417219069 578686766 739981933 591982401 362175448 1847679 956589227 553404417 796835308 101957901 199599833 636836044 189562212 235201601 893560314 351045720 67839...
result:
ok single line: '35043830 748071459 24317015 15... 126484862 596033393 343179224 '
Test #13:
score: 0
Accepted
time: 3ms
memory: 10812kb
input:
100 387 70 42 96 23 883900370 46 100 291665505 32 5 549582798 37 69 835270251 52 12 933544909 93 76 825342136 64 65 599793848 87 98 208143309 30 32 383044581 31 17 841508779 100 65 824740741 100 85 617220431 30 36 811058646 7 16 712383395 80 68 388038394 82 28 11872932 1 95 952695414 47 40 159975200...
output:
349959309 389151686 15576349 41057275 124545298 106659436 189083002 827773447 444785755 39940010 199690805 530419963 299468062 565214022 145095625 122980613 845035969 155681311 604044394 251482858 789106114 471608076 862151588 74293636 506263448 102486552 375847675 377879657 373949193 813575077 1800...
result:
ok single line: '349959309 389151686 15576349 4...7 451120346 145936921 33040489 '
Test #14:
score: 0
Accepted
time: 0ms
memory: 10528kb
input:
100 387 70 29 96 23 883900370 46 100 291665505 32 5 549582798 37 69 835270251 52 12 933544909 93 76 825342136 64 65 599793848 87 98 208143309 30 32 383044581 31 17 841508779 100 65 824740741 100 85 617220431 30 36 811058646 7 16 712383395 80 68 388038394 82 28 11872932 1 95 952695414 47 40 159975200...
output:
349959309 389151686 15576349 41057275 124545298 106659436 189083002 827773447 444785755 39940010 199690805 530419963 299468062 565214022 145095625 122980613 845035969 155681311 604044394 251482858 789106114 471608076 862151588 74293636 506263448 102486552 375847675 377879657 373949193 813575077 1800...
result:
ok single line: '349959309 389151686 15576349 4...5 296827892 575845434 20951359 '
Test #15:
score: 0
Accepted
time: 21ms
memory: 15124kb
input:
700 243150 64 580 589 94 181785684 677 249 888141670 535 137 821063194 411 676 699609298 356 70 858634249 324 44 223317388 558 1 534222120 195 295 102444539 2 601 557245517 77 565 234108761 649 585 250532879 85 112 105729936 309 10 696899807 79 538 237627335 544 597 226807387 277 530 546878834 147 3...
output:
58257 804804 1343433 2750598 100952 6468543 3335307 1108923 1822228 838487 5168935 8045859 417456 1485598 411791 1043846 1525829 2748029 3533683 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 7880313 1576850 9539348 2706787 3555086 390966 3110339 4320227 329216...
result:
ok single line: '58257 804804 1343433 2750598 1...6075010 475246 1640414 8500028 '
Test #16:
score: 0
Accepted
time: 12ms
memory: 14960kb
input:
700 243150 201 299 298 674 860646493 215 451 423248740 618 605 865867908 690 554 250363148 454 335 88561164 431 596 127725909 381 53 743625935 549 651 871860813 105 657 106220939 227 289 382995206 133 422 755116100 509 504 905981363 677 221 549408270 624 265 271525924 22 158 630115106 473 161 350238...
output:
58257 804804 1343433 2750598 100952 6468543 3335307 1108923 1822228 838487 5168935 8045859 417456 1485598 411791 1043846 1525829 2748029 3533683 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 7880313 1576850 9539348 2706787 3555086 390966 3110339 4320227 329216...
result:
ok single line: '58257 804804 1343433 2750598 1...6075010 475246 1640414 8500028 '
Test #17:
score: 0
Accepted
time: 33ms
memory: 14588kb
input:
700 243150 201 299 298 674 860646493 215 451 423248740 618 605 865867908 690 554 250363148 454 335 88561164 431 596 127725909 381 53 743625935 549 651 871860813 105 657 106220939 227 289 382995206 133 422 755116100 509 504 905981363 677 221 549408270 624 265 271525924 22 158 630115106 473 161 350238...
output:
58257 804804 1343433 2750598 100952 6468543 3335307 1108923 1822228 838487 5168935 8045859 417456 1485598 411791 1043846 1525829 2748029 3533683 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 7880313 1576850 9539348 2706787 3555086 390966 3110339 4320227 329216...
result:
ok single line: '58257 804804 1343433 2750598 1...6075010 475246 1640414 8500028 '
Test #18:
score: 0
Accepted
time: 25ms
memory: 15020kb
input:
700 243149 448 473 381 419 623014904 447 490 443081584 614 125 666564756 342 146 224116145 612 80 158718523 6 86 71769019 671 112 187983952 250 215 459075520 11 279 953185598 121 332 170496476 478 524 214111422 100 270 803708657 286 135 648638903 285 49 730737992 225 388 995110427 70 558 808552530 4...
output:
100952 6468543 3801046 5494034 1822228 3334210 5168935 9650469 417456 1819123 3742870 1043846 1525829 2966092 5159500 3827734 4228887 7509339 2950829 43123 3419400 2038404 3059035 3739850 8468194 1142213 8037028 5219573 2696497 4211037 3555086 2021556 3110339 5937978 329216 4049 9664711 9283191 1562...
result:
ok single line: '100952 6468543 3801046 5494034...1169105 2911167 2256081 802088 '
Test #19:
score: 0
Accepted
time: 33ms
memory: 18752kb
input:
700 243049 642 243 439 506 865550490 536 117 630308503 49 472 478102675 368 639 769850059 77 453 199976029 146 614 698398318 577 312 365553645 375 77 561208404 520 122 755775908 155 479 978061428 483 203 422954569 645 34 998320049 575 42 623841857 209 83 569840321 533 209 168913435 488 682 761465905...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #20:
score: 0
Accepted
time: 20ms
memory: 15180kb
input:
700 243156 424 593 560 353 89212441 470 461 992443540 644 412 790221005 651 624 869958149 54 160 389766862 128 92 941720636 633 340 879322315 427 202 730827362 248 579 112653186 329 298 849410893 403 119 297175173 403 476 902875334 426 371 861348482 668 504 169945565 589 623 518770923 650 140 579101...
output:
995739009 995095228 997860656 994442847
result:
ok single line: '995739009 995095228 997860656 994442847 '
Test #21:
score: 0
Accepted
time: 8ms
memory: 14932kb
input:
700 243156 424 660 560 353 89212441 470 461 992443540 644 412 790221005 651 624 869958149 54 160 389766862 128 92 941720636 633 340 879322315 427 202 730827362 248 579 112653186 329 298 849410893 403 119 297175173 403 476 902875334 426 371 861348482 668 504 169945565 589 623 518770923 650 140 579101...
output:
995739009 995095228 997860656 994442847 991906013
result:
ok single line: '995739009 995095228 997860656 994442847 991906013 '
Test #22:
score: 0
Accepted
time: 27ms
memory: 14932kb
input:
700 243156 424 454 560 353 89212441 470 461 992443540 644 412 790221005 651 624 869958149 54 160 389766862 128 92 941720636 633 340 879322315 427 202 730827362 248 579 112653186 329 298 849410893 403 119 297175173 403 476 902875334 426 371 861348482 668 504 169945565 589 623 518770923 650 140 579101...
output:
995739009 995095228
result:
ok single line: '995739009 995095228 '
Test #23:
score: 0
Accepted
time: 21ms
memory: 18776kb
input:
700 242156 647 441 494 179 984640856 49 200 44730812 693 185 894086266 329 242 883974048 317 513 768098864 314 532 646203439 692 332 386097236 640 610 476052402 354 325 115591830 499 610 421055545 215 296 16235097 466 251 446476261 128 394 576868150 371 163 671014536 468 63 724683861 41 374 40052318...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #24:
score: 0
Accepted
time: 22ms
memory: 14980kb
input:
700 244649 527 181 92 80 784371701 665 271 973916384 484 383 833826089 226 71 800387668 99 397 75662832 68 280 828021753 330 464 884071567 310 413 278665234 81 477 125333859 224 208 44586864 416 75 181599102 673 362 799491882 252 579 819362850 168 645 234160421 477 318 917919744 295 356 739751557 56...
output:
2748029 6775106 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 1576850 2696497 2706787 10303368 3555086 390966 3110339 329216 4049 11422641 4861039 2375848 156239 3003609 470327 3064615 939136 506790 1251625 829771 7389382 1458623 659405 2429709 1104137 928756 ...
result:
ok single line: '2748029 6775106 1278241 422888...6179105 711212 390575 16527722 '
Test #25:
score: 0
Accepted
time: 34ms
memory: 17304kb
input:
100000 100000 64268 47678 75936 92853 949383173 22354 47522 217427650 84144 17877 201110679 69083 76588 26178535 93694 56793 434733925 30814 89200 404739625 8122 73222 108893019 56186 85746 397875435 67907 84225 179106683 46847 96952 970754290 55038 26927 784257506 88077 60436 310647519 49638 54647 ...
output:
515440601 317564478 187177831 495444334 424752466 975961690 717660208 202710754 996285990 143711122 596830637 504993795 714269337 897042817 563814743 341404653 84482678 232859365 325956712 166551841 571397000 834584607 59105887 294743554 370720802 99184055 934060415 411191641 556947864 492426966 611...
result:
ok single line: '515440601 317564478 187177831 ... 544983258 660803791 611009357 '
Test #26:
score: 0
Accepted
time: 95ms
memory: 19452kb
input:
100000 300000 2817 17829 3316 98733 621542674 51323 65113 27896356 97665 9706 658469839 60843 42490 72548476 36293 68143 956084327 42653 48334 120918437 46709 56251 985562568 49450 2183 829632193 25993 75141 517990668 41450 22087 243037681 86339 57461 814996521 66284 87636 167879851 96221 21357 9729...
output:
166637302 194713999 56610547 328314156 510411395 399985951 39632166 101795231 131263597 126654420 138613351 455477761 19049809 330092341 5251504 131934782 17122336 52064955 97935351 281592115 79065390 958090260 80763864 18677652 249213978 240914675 130282509 848813990 76446968 64557344 41611069 6385...
result:
ok single line: '166637302 194713999 56610547 3...0 198102233 319436150 53877084 '
Test #27:
score: 0
Accepted
time: 59ms
memory: 19064kb
input:
99997 299176 93379 90717 48328 15140 587043307 37535 15903 348900100 77163 73959 232771469 90936 39195 135990134 16605 754 90420640 87579 20255 651678606 46771 22592 561615430 59192 36870 477121578 94905 8625 332569635 81733 63548 39862672 33979 57456 60174043 40634 32181 417672828 51420 79147 15266...
output:
93426332
result:
ok single line: '93426332 '
Test #28:
score: 0
Accepted
time: 66ms
memory: 19032kb
input:
99997 299176 93379 99165 48328 15140 587043307 37535 15903 348900100 77163 73959 232771469 90936 39195 135990134 16605 754 90420640 87579 20255 651678606 46771 22592 561615430 59192 36870 477121578 94905 8625 332569635 81733 63548 39862672 33979 57456 60174043 40634 32181 417672828 51420 79147 15266...
output:
93426332 185093989
result:
ok single line: '93426332 185093989 '
Test #29:
score: 0
Accepted
time: 53ms
memory: 19144kb
input:
99997 299177 66852 89357 48608 80671 673432051 52172 64028 351594412 21059 84759 777320867 6531 22534 237579479 81136 71301 961781059 28019 68052 656431593 11893 61088 307431265 24465 61006 263707202 67517 65728 586608689 49780 57409 420640815 8290 45546 775209921 80134 47488 279985899 16428 85896 2...
output:
285835617
result:
ok single line: '285835617 '
Test #30:
score: 0
Accepted
time: 56ms
memory: 19036kb
input:
99997 299177 66852 69837 48608 80671 673432051 52172 64028 351594412 21059 84759 777320867 6531 22534 237579479 81136 71301 961781059 28019 68052 656431593 11893 61088 307431265 24465 61006 263707202 67517 65728 586608689 49780 57409 420640815 8290 45546 775209921 80134 47488 279985899 16428 85896 2...
output:
285835617 93426332
result:
ok single line: '285835617 93426332 '
Test #31:
score: 0
Accepted
time: 89ms
memory: 19284kb
input:
99997 299177 66852 21692 48608 80671 673432051 52172 64028 351594412 21059 84759 777320867 6531 22534 237579479 81136 71301 961781059 28019 68052 656431593 11893 61088 307431265 24465 61006 263707202 67517 65728 586608689 49780 57409 420640815 8290 45546 775209921 80134 47488 279985899 16428 85896 2...
output:
285835617 93426332 185093989 191966981 527967466 110087401 112062717 187626692 820958975 156603335 665343509 214646132 382140821 364704219 481110234 359623461 508627672 104541986 515248127 110354560 900157762 893295186 140200836 240643415 99379371 285039612 24927459 553075450 294279300 99613882 5698...
result:
ok single line: '285835617 93426332 185093989 1...486 414340 187734611 343984632 '
Test #32:
score: 0
Accepted
time: 99ms
memory: 22324kb
input:
99997 279177 66852 21692 55626 68802 6897758 92864 54369 43149162 9273 97294 879345298 14603 52050 3017480 31400 78984 238518714 6790 57567 945692767 46901 91117 86130110 14623 86191 221521323 26741 56593 229826446 80456 13272 757213758 40594 33531 233738969 94880 62700 349353445 53707 52097 8764564...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #33:
score: 0
Accepted
time: 31ms
memory: 17564kb
input:
99997 238439 76110 94862 67336 41680 95457619 62570 39286 630213211 99721 54957 90893155 32990 39381 429764919 39267 23985 785569508 56413 24942 527614726 16047 37440 487527680 93694 20888 675302709 80888 98460 897076346 86800 67293 912385615 55897 30024 171043783 95765 89080 520226050 62283 60815 2...
output:
791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...
result:
ok single line: '791392824 862991398 2922244 71... 538907671 616391060 752599998 '
Test #34:
score: 0
Accepted
time: 32ms
memory: 17500kb
input:
99997 238439 76110 28597 67336 41680 95457619 62570 39286 630213211 99721 54957 90893155 32990 39381 429764919 39267 23985 785569508 56413 24942 527614726 16047 37440 487527680 93694 20888 675302709 80888 98460 897076346 86800 67293 912385615 55897 30024 171043783 95765 89080 520226050 62283 60815 2...
output:
791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...
result:
ok single line: '791392824 862991398 2922244 71... 616391060 752599998 822642871 '
Test #35:
score: 0
Accepted
time: 56ms
memory: 17444kb
input:
99997 238439 76110 2020 67336 41680 95457619 62570 39286 630213211 99721 54957 90893155 32990 39381 429764919 39267 23985 785569508 56413 24942 527614726 16047 37440 487527680 93694 20888 675302709 80888 98460 897076346 86800 67293 912385615 55897 30024 171043783 95765 89080 520226050 62283 60815 21...
output:
791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...
result:
ok single line: '791392824 862991398 2922244 71... 752599998 822642871 541518222 '
Test #36:
score: 0
Accepted
time: 8ms
memory: 12388kb
input:
99997 38436 64268 9758 92024 23589 803259032 76411 65909 15701814 51235 55345 883081403 83649 16253 621910594 53896 54119 150125091 98319 49363 928461881 11710 33119 268517541 64973 73501 989782246 57612 80151 888627707 27973 33485 559182144 53426 32663 968332726 20223 40069 820134687 38118 994 9452...
output:
581388083 71270375
result:
ok single line: '581388083 71270375 '
Test #37:
score: 0
Accepted
time: 37ms
memory: 17552kb
input:
99997 238439 76110 63099 67336 41680 95457619 62570 39286 630213211 99721 54957 90893155 32990 39381 429764919 39267 23985 785569508 56413 24942 527614726 16047 37440 487527680 93694 20888 675302709 80888 98460 897076346 86800 67293 912385615 55897 30024 171043783 95765 89080 520226050 62283 60815 2...
output:
791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...
result:
ok single line: '791392824 862991398 2922244 71... 969794002 952332760 412970412 '
Test #38:
score: 0
Accepted
time: 55ms
memory: 17348kb
input:
99997 221267 82012 55918 40464 67128 683499895 9080 1581 385876835 86856 97088 168257596 33901 89072 957937896 65441 12498 828951733 78304 37466 415502367 97822 30733 510848600 19951 45304 640469658 77032 75099 885282186 47876 86084 459197216 97341 52837 763795955 94337 51538 291721212 22167 33026 1...
output:
693020011 630060194 128940950 305040846 615987390 849223939 676950162 868420197 842075747 249126258 909015325 509539167 637554941 730813438 852623277 287680663 915702027 858579761 630622417 955822222 71292000 116514890 111896380 812796493 414982422 264896204 261873679 549469370 540423125 442400496 8...
result:
ok single line: '693020011 630060194 128940950 ... 694921374 623311161 828506165 '
Test #39:
score: 0
Accepted
time: 68ms
memory: 18640kb
input:
99997 278439 14927 44993 11777 5257 993971567 90756 9362 189401090 52659 82805 866434190 4909 21823 427180872 28578 45587 637831743 97024 54879 952333217 24054 46661 705296524 65684 33867 293683934 18720 33710 69276107 75817 13522 506589858 2717 56138 167596965 38182 29396 837956117 51101 90590 3581...
output:
7743720 476051872 26637941 234058604 438628507 219160491 237788393 395326131 43277853 784824965 702557525 215806455 309044724 607100755 303150849 14790882 964885018 221373863 193451670 269857756 461692186 856872733 618937171 22009722 281712856 40173458 373632140 414860393 494835578 92006031 58351675...
result:
ok single line: '7743720 476051872 26637941 234...82 169420984 417566643 5466738 '
Test #40:
score: 0
Accepted
time: 92ms
memory: 22180kb
input:
99997 278439 2094 90716 78960 72569 964912324 91642 48978 29178132 57644 36767 960427366 33060 27896 541127437 49547 26683 16663412 83852 14905 131428803 14494 27035 981202345 5872 47159 556754607 25059 38643 779763760 15794 68844 429414920 74651 77605 816445646 58736 85392 240953374 32922 49379 532...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #41:
score: 0
Accepted
time: 79ms
memory: 19428kb
input:
100000 299999 8885 53321 99585 35264 454174952 11172 59937 476508053 56711 38940 946371325 99761 99180 506012965 1803 96170 442898557 26417 48281 525632860 33115 47573 618478424 91199 22866 74647853 60411 86371 370289885 91105 98557 444722737 61700 63831 123123796 11265 11903 954357438 4768 74801 65...
output:
390700402 166637302 56610547 360564346 328314156 510411395 399985951 39632166 387112584 126654420 306507629 138613351 50733828 377735956 5251504 68419556 17122336 118956084 52064955 281592115 79065390 190161504 90756485 18677652 470193694 249213978 240914675 130282509 76446968 467223152 64557344 416...
result:
ok single line: '390700402 166637302 56610547 3...0 50284754 231263353 329767280 '
Test #42:
score: 0
Accepted
time: 73ms
memory: 19332kb
input:
100000 299999 8885 87852 99585 35264 454174952 11172 59937 476508053 56711 38940 946371325 99761 99180 506012965 1803 96170 442898557 26417 48281 525632860 33115 47573 618478424 91199 22866 74647853 60411 86371 370289885 91105 98557 444722737 61700 63831 123123796 11265 11903 954357438 4768 74801 65...
output:
390700402 166637302 56610547 360564346 328314156 510411395 399985951 39632166 387112584 126654420 306507629 138613351 50733828 377735956 5251504 68419556 17122336 118956084 52064955 281592115 79065390 190161504 90756485 18677652 470193694 249213978 240914675 130282509 76446968 467223152 64557344 416...
result:
ok single line: '390700402 166637302 56610547 3...5 508303787 569361023 62028751 '
Test #43:
score: 0
Accepted
time: 63ms
memory: 19260kb
input:
100000 299219 19979 58533 21267 90280 599733056 20253 72731 268312565 92484 73827 388303500 84578 27643 775074127 57075 86835 58697620 37908 56539 57591959 30920 66287 247420030 65943 87388 544593531 50505 22643 989332327 46613 41968 539530189 19051 66876 594442251 47216 33068 406909426 50511 52675 ...
output:
131949422 85100909 80856037 222360673 441095959 943419452 184837580 320721049 169071893 388500783 232592982 113220917 34194802 823388741 617472213 375984684 202271349 735097269 129534889 14786342 340367878 103854261 139488922 26831335 458561208 151751927 277411256 603632311 121855824 21765697 155767...
result:
ok single line: '131949422 85100909 80856037 22... 265500640 302408294 750629031 '
Test #44:
score: 0
Accepted
time: 23ms
memory: 17252kb
input:
100000 99218 64268 30064 48955 87888 565222201 18595 39188 967538923 87891 26789 653097384 18460 88076 784053832 2525 34466 932103860 70417 68518 914279015 44300 93551 750042330 4118 48387 332807684 98670 98704 668966190 7999 13154 904581319 5302 47018 827570978 23722 97890 608754233 80767 19919 912...
output:
515440601 317564478 187177831 495444334 424752466 975961690 717660208 202710754 996285990 143711122 596830637 504993795 714269337 897042817 563814743 341404653 84482678 232859365 325956712 166551841 571397000 834584607 59105887 294743554 370720802 99184055 934060415 411191641 556947864 492426966 611...
result:
ok single line: '515440601 317564478 187177831 ... 920318463 394898197 432313242 '
Test #45:
score: 0
Accepted
time: 38ms
memory: 17368kb
input:
100000 99218 64268 39717 48955 87888 565222201 18595 39188 967538923 87891 26789 653097384 18460 88076 784053832 2525 34466 932103860 70417 68518 914279015 44300 93551 750042330 4118 48387 332807684 98670 98704 668966190 7999 13154 904581319 5302 47018 827570978 23722 97890 608754233 80767 19919 912...
output:
515440601 317564478 187177831 495444334 424752466 975961690 717660208 202710754 996285990 143711122 596830637 504993795 714269337 897042817 563814743 341404653 84482678 232859365 325956712 166551841 571397000 834584607 59105887 294743554 370720802 99184055 934060415 411191641 556947864 492426966 611...
result:
ok single line: '515440601 317564478 187177831 ... 432313242 387654943 611810177 '
Test #46:
score: 0
Accepted
time: 68ms
memory: 19276kb
input:
100000 299918 88061 96071 41398 32757 964915138 84465 2066 632231800 21226 52269 869418813 94475 65538 221322702 80157 85784 283596547 20841 81363 613108630 52373 50181 333314622 41342 11539 672017864 64892 63320 878478233 10901 81506 355460493 35728 64914 323034686 35701 4985 206183759 99827 33261 ...
output:
643791589 213700947 226767753 383034540 562557936 520690631 15297372 205594744 378818930 546065609 5163433 20996679 91654028 991638678 345111166 568469462 246193094 909546008 205797474 280133879 359317409 324595116 484569938 301291454 473954367 407769469 319775971 66342247 51790361 290021044 1637179...
result:
ok single line: '643791589 213700947 226767753 ...87 191449829 23669689 48521987 '
Test #47:
score: 0
Accepted
time: 43ms
memory: 17516kb
input:
100000 299918 2817 47894 18295 3965 86955356 60128 82537 876600264 36400 64924 126716452 10460 74048 530652187 19777 87427 330914712 20310 17843 734612878 52312 55374 684621877 41880 98555 934369487 35935 8970 490897373 34238 1896 606232191 19523 31816 786829588 96693 63587 327986023 62673 84075 952...
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #48:
score: 0
Accepted
time: 90ms
memory: 22520kb
input:
100000 290000 79303 87790 23289 92262 552605605 36658 34870 518462670 75317 80144 63763134 57734 42665 947188452 41007 61234 509996304 40209 10839 898340897 48019 3403 93828921 15848 30884 32863130 78853 71848 720969443 20969 92998 976470167 30538 3200 705878590 196 45304 640437508 70500 27876 30169...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #49:
score: 0
Accepted
time: 101ms
memory: 22624kb
input:
100000 299998 79303 87790 6379 76905 665938795 27660 73630 235140247 16118 73951 680852225 28181 1102 19859862 38920 50452 38073458 42193 94185 479866395 63532 79253 194308848 43247 16992 656395118 71 60113 747805998 5397 59641 280133756 31850 14410 63946601 96968 30760 703408732 6442 30979 53150640...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #50:
score: 0
Accepted
time: 33ms
memory: 19844kb
input:
100000 200508 12683 37055 17776 64324 989357784 42582 92225 275341537 31571 88091 933919181 89910 58325 123872768 42132 45698 482146877 112 14558 727378400 86200 78532 110150880 17776 1373 926333142 42132 45810 264427085 19923 11433 672067611 86200 26950 30771985 42132 25948 573431025 19923 8230 884...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #51:
score: 0
Accepted
time: 45ms
memory: 19808kb
input:
100000 200605 36829 64640 66295 49039 130477007 44485 44230 410768842 82694 41580 441681114 62323 42954 560341980 10964 81297 438734339 90446 75184 799799143 65183 27408 973001472 11373 81270 408185130 41007 88221 308281654 95774 21144 499198729 73693 24812 281299148 65183 52891 512921412 63138 8176...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #52:
score: 0
Accepted
time: 73ms
memory: 20840kb
input:
100000 299995 47491 73902 39245 17769 514607255 39245 68790 690953017 41818 22445 338434505 42001 11263 923027815 39245 29060 736181137 42001 90301 856134503 41818 81236 557818018 41818 74826 441779794 39245 35412 81238889 41818 81736 805276901 41818 95743 558776376 41818 22415 989204730 41818 87767...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #53:
score: 0
Accepted
time: 24ms
memory: 19700kb
input:
100000 199994 61904 59777 80350 12959 17468107 18595 82099 648318424 18595 1051 97953198 80350 54370 580906069 18595 97839 228954697 18595 99552 661062756 80350 65389 540112328 80350 64301 209558723 80350 89535 708062154 80350 3221 965021487 80350 4262 428729156 18595 621 666995613 18595 19426 20007...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #54:
score: 0
Accepted
time: 0ms
memory: 10408kb
input:
100000 12 64268 30167 86198 80658 202710754 27748 86198 717660208 66535 9758 317564478 64268 66535 515440601 93419 2528 596830637 11614 93419 143711122 83488 27748 975961690 84212 83488 424752466 9758 42907 187177831 80658 11614 996285990 42907 84212 495444334 2528 9758 504993795
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #55:
score: 0
Accepted
time: 2ms
memory: 10632kb
input:
10 90 1 3 1 7 177408115 1 2 342765194 1 6 441583657 1 10 581533097 1 8 682632362 1 9 753778917 1 5 866723754 1 4 940071994 1 3 983458886 7 8 196564223 7 9 289848404 7 3 315557285 7 4 336895138 7 2 339092214 7 10 360026868 7 6 382961801 7 5 475402312 7 1 613336099 8 10 366915360 8 4 422927986 8 7 615...
output:
177408115 196564223 366915360 43453404 11881434 44991256 133275785 63303853 66876456
result:
ok single line: '177408115 196564223 366915360 ...56 133275785 63303853 66876456 '
Test #56:
score: 0
Accepted
time: 2ms
memory: 10652kb
input:
4 12 3 4 3 1 368092233 3 4 830012704 3 2 970867786 1 2 552173389 1 3 683536728 1 4 912122645 2 4 192550219 2 1 414842218 2 3 743144908 4 3 28748732 4 1 69356287 4 2 902236202
output:
368092233 552173389 192550219
result:
ok single line: '368092233 552173389 192550219 '
Test #57:
score: 0
Accepted
time: 28ms
memory: 14748kb
input:
500 249500 183 9 183 205 532943 183 167 3436472 183 182 6941917 183 52 7041448 183 317 9271489 183 324 21225420 183 304 23927427 183 259 25360686 183 457 30817984 183 498 31401569 183 61 34588853 183 496 36991329 183 165 37886159 183 499 38828754 183 199 39236776 183 328 40311929 183 73 40438508 183...
output:
532943 270533 551552 187757 1937402 7110365 120295 524028 2318518 4866812 284279 2193033 3585990 4127772 1613265 3442831 4499340 8877996 2056097 4995954 3998348 1112558 380451 1269618 991148 7757171 1440123 192058 2214444 1338473 677574 330444 823319 5067147 1565028 2705433 1496665 867892 2683739 99...
result:
ok single line: '532943 270533 551552 187757 19...5 2764337 5509060 286500 18422 '
Test #58:
score: 0
Accepted
time: 28ms
memory: 16504kb
input:
547 298662 356 434 356 270 4407419 356 113 4662127 356 197 13820289 356 316 15052702 356 423 17159769 356 406 18920256 356 452 20541605 356 7 20970006 356 231 22275166 356 266 23070596 356 540 31281586 356 353 33384121 356 417 35744668 356 496 37100023 356 277 38495977 356 422 38550555 356 338 40335...
output:
4407419 2645974 5069278 1937070 303807 465075 2739908 1651197 1896621 513190 1717754 2896951 2314121 1533883 2655992 1683199 7063553 3127267 6048 4643183 3849083 3921155 1485074 193410 4381027 3273130 1921713 4791949 3409578 151674 2085146 1577620 3954315 264248 1960708 5338357 2418459 501650 413302...
result:
ok single line: '4407419 2645974 5069278 193707...1 666345 696966 652431 3386624 '
Test #59:
score: 0
Accepted
time: 31ms
memory: 15912kb
input:
1000 277351 196 708 123 228 455920704 563 705 835221609 807 85 631033500 948 179 838244915 973 617 166612721 322 11 291591205 319 561 236697655 833 690 52755770 504 49 817036531 697 524 653339322 664 30 140781398 531 66 365418782 820 67 261291563 621 94 426142792 896 499 522303025 739 718 449808206 ...
output:
17295128 2012753 16661648 5528697 1625663 12949169 5320485 17085039 4282797 1536838 17068221 17361509 5175294 2123184 2109119 7594807 1720633 3697574 366297 4240458 967425 3850831 560768 5004814 5023228 275335 4208113 5809045 5070114 2092019 285364 3435313 3234253 366607 6583363 6025085 1875085 3715...
result:
ok single line: '17295128 2012753 16661648 5528...12684 21210292 9403493 1597059 '
Test #60:
score: 0
Accepted
time: 30ms
memory: 16468kb
input:
2000 294301 209 1886 1600 1435 428925560 419 687 402510588 890 1959 146446737 1752 1969 271002350 1398 440 545942657 1818 1595 261825639 403 1481 443679560 659 1815 490192538 674 1247 706694749 990 211 967849985 1800 315 628603690 1399 738 158091401 547 156 291194398 618 93 449737597 1242 334 640302...
output:
16507250 10417305 22655001 2189346 14030554 17928908 28752289 21201602 20093727 18158595 3867021 21459401 5041786 21777887 3101619 12081974 22822967 9669389 5800981 5074409 14982921 286697 1698340 3983893 5427196 4638394 3350173 10819636 8112499 3310922 13560882 254969 4407419 4662127 15052702 20970...
result:
ok single line: '16507250 10417305 22655001 218...56983 21789380 222019 13113148 '
Test #61:
score: 0
Accepted
time: 22ms
memory: 21688kb
input:
100000 299993 1 3 1 2 1 2 1 2 1 4 9 2 4 10 4 3 11 1 5 12 2 5 13 5 3 14 1 6 15 2 6 16 6 3 17 1 7 18 2 7 19 7 3 20 1 8 21 2 8 22 8 3 23 1 9 24 2 9 25 9 3 26 1 10 27 2 10 28 10 3 29 1 11 30 2 11 31 11 3 32 1 12 33 2 12 34 12 3 35 1 13 36 2 13 37 13 3 38 1 14 39 2 14 40 14 3 41 1 15 42 2 15 43 15 3 44 1...
output:
TOO LONG
result:
ok single line: 'TOO LONG'
Test #62:
score: 0
Accepted
time: 67ms
memory: 17256kb
input:
100000 300000 25994 17643 37843 43494 569244858 15969 43452 876539361 54882 31175 699372949 59159 10860 279638009 71843 69836 985738526 56860 13890 702802526 56571 89946 782376059 82147 74358 455743656 86312 81894 683263251 50299 79026 175361193 79650 63722 241911863 72162 54064 857921957 53932 8334...
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #63:
score: 0
Accepted
time: 8ms
memory: 12200kb
input:
100000 50000 51645 69416 98861 64094 265382714 39093 82580 426888669 89228 4615 383236866 28111 19629 830475260 66467 7155 591947450 42257 13925 941991116 74283 95043 931340487 34116 73427 139254431 46667 58466 704807917 50676 72360 223360025 16031 64423 243333893 29679 98429 836470195 50696 56396 9...
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #64:
score: 0
Accepted
time: 1ms
memory: 10460kb
input:
10 0 3 2
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #65:
score: 0
Accepted
time: 53ms
memory: 16644kb
input:
50000 300000 44440 29592 45195 47001 463543895 48058 21861 239158692 14984 442 113296885 40376 19170 815226748 5078 16082 93220407 1640 41020 204633899 8564 915 311436490 40104 6057 822069673 1149 10673 312069579 18897 37131 588174339 40566 31742 973912922 8497 25805 863145383 20059 39647 942060925 ...
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #66:
score: 0
Accepted
time: 24ms
memory: 16312kb
input:
579 299999 475 439 349 297 191921374 112 528 814604396 489 55 36411478 298 152 454537417 16 7 813434397 464 270 826095523 164 419 782720000 140 3 801629148 475 452 614066415 309 205 821082433 168 210 741103543 81 458 270791548 132 280 969572725 415 269 214007381 547 179 378036118 417 42 858307115 24...
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #67:
score: 0
Accepted
time: 85ms
memory: 18180kb
input:
50000 299989 45319 5774 25930 24127 738166929 16633 49925 445109623 19236 23567 81875405 1708 2675 428326016 47240 38724 49902641 35385 7739 508293817 48047 21663 701051772 2015 6910 321963516 12678 4346 958921088 15339 48652 863134622 22693 47279 646718912 19822 44233 467740960 4825 24953 433609908...
output:
67513314 558702172 231555984 372793401 39433372 130033549 184238715 134517689 68752500 155256328 135620354 196248374 58872021 125353317 239160871 66005301 79029319 213209042 502680115 170181546 228745617 37295480 19375294 100887926 247681201 66213677 91042597 10308820 201914159 166490381 37171717 25...
result:
ok single line: '67513314 558702172 231555984 3...890 2399436 291416401 45098767 '
Test #68:
score: 0
Accepted
time: 52ms
memory: 17560kb
input:
30000 299971 19804 28001 21220 20759 27705873 21298 6549 906931196 10572 29858 930194735 14945 16719 659236522 9418 23387 858552997 4669 13256 660871598 29286 22459 403239908 7430 1063 221185533 84 5885 58766078 15210 2002 487923605 14703 16602 901018955 11264 2709 467742402 7595 26767 24297010 2124...
output:
362385457 74760017 382991234 60495585 4628323 26627575 176607163 9308289 35675539 136129 139265789 50303567 59881098 76180942 2126030 11874732 90735938 67096362 120180293 99955347 12688730 13372045 18207050 163631242 246663429 201288841 39954535 522924228 117523882 65958343 142830275 50101236 409955...
result:
ok single line: '362385457 74760017 382991234 6...50 27482214 210569385 37302932 '