QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#33603#4206. Event HoppingSuffixTree#45 64ms18628kbC++171.5kb2022-06-04 08:53:562024-05-26 00:09:20

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 51ms
memory: 18628kb

input:

100000 100000
825913690 825916363
333322014 333324481
302015784 302018251
841002775 841005448
810249910 810252583
803554045 803556718
379590599 379593066
413477311 413479778
304105333 304107800
856802878 856805551
355907399 355909866
365590374 365592841
813775597 813778270
816058339 816061012
383873...

output:

1
impossible
1
impossible
impossible
impossible
31336
impossible
impossible
impossible
impossible
27166
16274
impossible
impossible
impossible
impossible
impossible
impossible
21353
17890
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
67...

result:

wrong answer 44433rd lines differ - expected: '0', found: '1'

Subtask #2:

score: 10
Accepted

Test #13:

score: 10
Accepted
time: 0ms
memory: 8000kb

input:

1000 100
67878298 387720407
270457472 922959000
286470357 618323410
260791474 282940414
301337446 553875076
478221503 724555102
380447228 437131400
191801427 465825895
366088873 431222136
49483883 103442781
699926238 720636919
253150351 291688158
411085513 727726933
444078045 496386017
420626857 822...

output:

1
2
2
impossible
1
2
1
2
impossible
2
2
impossible
impossible
impossible
1
impossible
impossible
impossible
impossible
impossible
2
impossible
2
impossible
1
1
impossible
1
1
1
1
impossible
2
impossible
2
impossible
1
1
impossible
impossible
impossible
1
2
impossible
impossible
1
2
impossible
imposs...

result:

ok 100 lines

Test #14:

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

input:

1000 100
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 100...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 100 lines

Test #15:

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

input:

1000 100
219652137 219887840
411750082 411985785
295784206 296019909
323361457 323597160
263257192 263492895
228373148 228608851
311812010 312047713
189246450 189482153
197024649 197260352
214230968 214466671
209045502 209281205
282113432 282349135
277870778 278106481
394308060 394543763
318175991 3...

output:

999
998
998
997
997
997
996
996
996
996
995
995
995
995
995
994
994
994
994
994
994
993
993
993
993
993
993
993
992
992
992
992
992
992
992
992
991
991
991
991
991
991
991
991
991
990
990
990
990
990
990
990
990
990
990
989
989
989
989
989
989
989
989
989
989
989
988
988
988
988
988
988
988
988
988
...

result:

ok 100 lines

Test #16:

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

input:

1000 100
146460236 650840147
213248988 712234443
271625877 765585418
268035474 762542588
155957999 659365570
108300122 614352264
161735587 665204546
244432982 734605513
84404294 596250403
472975048 964576612
128756912 628710941
130473656 631636782
324178293 813816145
197620586 692901130
353485130 84...

output:

impossible
1
impossible
impossible
1
impossible
impossible
impossible
1
1
impossible
1
impossible
1
impossible
impossible
1
1
impossible
impossible
1
impossible
1
1
1
impossible
impossible
impossible
impossible
1
1
1
impossible
impossible
impossible
impossible
1
1
impossible
impossible
1
1
1
1
impos...

result:

ok 100 lines

Test #17:

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

input:

1000 100
734527256 734722851
176171640 176781511
73713312 74323183
347545391 348155262
741959866 742155461
727094646 727290241
304244550 304854421
256064741 256674612
692278736 692474331
678391491 678587086
757020681 757216276
324370293 324980164
327419648 328029519
720248821 720444416
253015386 253...

output:

1
impossible
1
impossible
246
334
impossible
impossible
impossible
477
impossible
379
impossible
impossible
393
196
impossible
271
122
impossible
impossible
impossible
impossible
impossible
207
impossible
impossible
190
impossible
impossible
impossible
impossible
impossible
impossible
impossible
imp...

result:

ok 100 lines

Test #18:

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

input:

1000 100
549 550
689 690
273 274
760 761
414 415
639 640
420 421
592 593
308 309
55 56
952 953
181 182
2 3
476 477
262 263
329 330
261 262
875 876
78 79
711 712
771 772
871 872
328 329
585 586
185 186
471 472
191 192
611 612
758 759
538 539
24 25
518 519
903 904
748 749
547 548
435 436
81 82
459 460...

output:

impossible
impossible
impossible
554
impossible
impossible
impossible
661
712
333
impossible
impossible
impossible
impossible
impossible
impossible
329
impossible
101
416
impossible
268
impossible
676
impossible
131
impossible
impossible
impossible
337
impossible
417
impossible
231
impossible
146
im...

result:

ok 100 lines

Test #19:

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

input:

1000 100
41916637 42739142
57513660 58326077
21867551 172652993
148410501 243619298
80759769 81439087
1165860 77201426
122988614 155997027
100181236 100563028
185001902 185375949
176810589 177691863
141890410 142849915
92309958 240703409
40538462 236387490
22164234 22167602
144201862 144991292
19678...

output:

2
1
2
impossible
impossible
impossible
impossible
1
1
3
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
1
2
impossible
impossible
impossible
impossible
1
impossible
impossible
2
impossible
2
impossible
1
impossible
impossible
impossible
i...

result:

ok 100 lines

Test #20:

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

input:

5 2
1 3
2 4
4 7
7 9
3 7
1 4
3 2

output:

2
impossible

result:

ok 2 lines

Subtask #3:

score: 0
Wrong Answer

Dependency #2:

100%
Accepted

Test #21:

score: 15
Accepted
time: 19ms
memory: 9636kb

input:

5000 100000
444771902 444813193
517939554 517980845
420657958 420699249
565300331 565341622
489902965 489944256
550146534 550187825
621579964 621621255
541970916 542012207
504932889 504974180
509970391 510011682
548990386 549031677
531606875 531648166
611628833 611670124
424167693 424208984
43593562...

output:

4999
4998
4998
4997
4997
4997
4996
4996
4996
4996
4995
4995
4995
4995
4995
4994
4994
4994
4994
4994
4994
4993
4993
4993
4993
4993
4993
4993
4992
4992
4992
4992
4992
4992
4992
4992
4991
4991
4991
4991
4991
4991
4991
4991
4991
4990
4990
4990
4990
4990
4990
4990
4990
4990
4990
4989
4989
4989
4989
4989
...

result:

ok 100000 lines

Test #22:

score: 0
Accepted
time: 18ms
memory: 9232kb

input:

5000 100000
688560220 703238347
121237680 134739514
589367489 602957567
728869127 745336729
9219545 23878334
488274497 501448797
849072503 861443731
23334524 37448893
956275044 970586285
583628356 597394100
810104747 824856103
110253553 124899493
522891845 536665379
912913517 928831291
329446513 344...

output:

72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
72
...

result:

ok 100000 lines

Test #23:

score: -15
Wrong Answer
time: 14ms
memory: 9432kb

input:

5000 100000
464713443 865027233
131041097 776120588
45181466 960870814
305598230 729604420
388398945 419250976
829797468 854954202
59180550 180848104
418991469 450843968
275526402 990751155
640426851 978213959
46548208 208716873
689084357 728560507
219423180 394015921
201718277 911951270
258428409 5...

output:

impossible
2
impossible
impossible
1
impossible
impossible
1
2
impossible
impossible
impossible
2
1
2
impossible
impossible
impossible
impossible
impossible
2
impossible
impossible
impossible
impossible
impossible
1
1
1
1
2
impossible
2
impossible
impossible
impossible
2
impossible
2
2
1
impossible
...

result:

wrong answer 13471st lines differ - expected: '0', found: '1'

Subtask #4:

score: 15
Accepted

Dependency #2:

100%
Accepted

Test #28:

score: 15
Accepted
time: 20ms
memory: 16280kb

input:

100000 100
339859414 339860443
735166371 735174392
348212836 348213865
888215072 888223093
792396206 792404227
329405875 329405966
323863609 323864638
349411621 349412650
805520775 805526215
780236547 780238983
878461536 878469557
329490782 329490797
689599070 689607091
333606181 333607210
778431645...

output:

1
impossible
1
1
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
27759
impossible
impossible
impossible
6549
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossib...

result:

ok 100 lines

Test #29:

score: 0
Accepted
time: 23ms
memory: 16392kb

input:

100000 100
280307395 780690393
181760327 682061905
249141989 749145209
101786854 602796452
340240072 840752657
462512152 963603974
278949510 779337310
449036112 949680311
109301519 610340212
150526076 651104530
358730138 858979032
68024728 568795044
246222731 746352341
323835391 824440662
17574686 5...

output:

impossible
1
1
impossible
impossible
impossible
impossible
1
1
impossible
1
1
1
1
impossible
1
impossible
1
1
1
1
impossible
impossible
1
1
impossible
1
1
1
impossible
1
1
impossible
1
1
1
impossible
1
1
1
1
impossible
1
1
1
impossible
impossible
impossible
impossible
1
impossible
1
1
1
1
1
1
1
impo...

result:

ok 100 lines

Test #30:

score: 0
Accepted
time: 27ms
memory: 16388kb

input:

100000 100
37531 37532
31892 31893
34221 34222
44773 44774
89978 89979
21900 21901
61685 61686
82235 82236
36098 36099
28834 28835
84481 84482
70886 70887
82077 82078
41874 41875
46072 46073
35264 35265
35193 35194
4306 4307
64390 64391
9820 9821
6247 6248
12022 12023
41716 41717
31919 31920
13011 1...

output:

25296
31189
impossible
impossible
37894
48145
53829
12181
32792
impossible
6662
12366
27899
impossible
impossible
87018
impossible
46497
21534
54333
18163
impossible
impossible
12578
29638
impossible
2822
8396
impossible
59485
impossible
impossible
56389
29711
impossible
impossible
impossible
35036
...

result:

ok 100 lines

Test #31:

score: 0
Accepted
time: 11ms
memory: 16376kb

input:

100000 100
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 100 lines

Test #32:

score: 0
Accepted
time: 24ms
memory: 16380kb

input:

100000 100
994730204 997656824
997559746 999567570
437348231 440622053
186684423 190058231
354732010 357982869
88038861 91159348
586962168 590266642
589162214 592446488
887112000 890350184
558903873 562255286
137259291 140476440
75063570 78383641
73162753 76265253
817355711 820703630
124571212 12768...

output:

317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
...

result:

ok 100 lines

Test #33:

score: 0
Accepted
time: 18ms
memory: 15964kb

input:

100000 100
469284050 469287411
619016600 619019961
614909458 614912819
654522204 654525565
689268222 689271583
498202094 498205455
679480990 679484351
417423820 417427181
611813977 611817338
498124791 498128152
638681811 638685172
436544549 436547910
526226112 526229473
524451504 524454865
735169399...

output:

99999
99998
99998
99997
99997
99997
99996
99996
99996
99996
99995
99995
99995
99995
99995
99994
99994
99994
99994
99994
99994
99993
99993
99993
99993
99993
99993
99993
99992
99992
99992
99992
99992
99992
99992
99992
99991
99991
99991
99991
99991
99991
99991
99991
99991
99990
99990
99990
99990
99990
...

result:

ok 100 lines

Test #34:

score: 0
Accepted
time: 25ms
memory: 16784kb

input:

100000 100
6059124 201337475
38781686 38782031
4828068 4829350
55491778 55496029
44594840 53249244
157539214 157543225
6323925 234008984
4875446 248654555
672428 203042073
75561632 75565875
181604802 181605327
78707086 78710336
101917893 140682994
16658418 16662566
44321226 44327781
238892713 238895...

output:

2
impossible
2
impossible
2
impossible
impossible
3
impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
2
2
1
impossible
1
impossible
1
impossible
impossible
impossible
1
impossible
impossible
1
3
impossible
impossible
impossible
impossible
impossible
impossible
2...

result:

ok 100 lines

Subtask #5:

score: 20
Accepted

Test #35:

score: 20
Accepted
time: 38ms
memory: 17244kb

input:

100000 100000
903318459 905410836
903528407 905653109
925180437 927048927
473524826 475597377
362562616 364539688
644980844 646918450
242583398 244653279
506338025 508361063
481496693 483530832
970053326 972147109
794840350 796900045
130664210 132709680
634100524 636336820
844429264 846504591
652483...

output:

500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
500
...

result:

ok 100000 lines

Test #36:

score: 0
Accepted
time: 60ms
memory: 18628kb

input:

100000 100000
280978238 281996879
128582305 129520369
326480847 327450886
613575910 614525870
773187456 774194521
499427531 500501109
206817453 207828231
147432355 148457712
276397611 277442951
238269352 239211898
864332415 865500617
189404293 190348043
898692256 899607594
395766418 396755456
306101...

output:

impossible
434
impossible
248
338
332
390
impossible
607
771
246
impossible
421
impossible
628
117
549
impossible
impossible
impossible
382
impossible
495
impossible
impossible
357
impossible
522
impossible
54
impossible
impossible
impossible
464
impossible
impossible
225
255
484
60
86
244
579
363
7...

result:

ok 100000 lines

Test #37:

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

input:

100000 100000
315328227 565342348
172493343 423278396
47077854 218308141
77736924 280882803
578420376 829121844
456477365 706164084
572351871 823109648
47238838 218708768
818302749 971917023
250574858 500783122
101021436 327649552
386731775 636229046
560750614 811328057
649806442 888787931
89426598 ...

output:

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
...

result:

ok 100000 lines

Test #38:

score: 0
Accepted
time: 43ms
memory: 18440kb

input:

100000 100000
532703099 533766917
18747285 19717390
259741440 260161102
33247104 34339796
221460611 222216066
101759380 103356345
868641980 869660917
400488522 402221013
626943992 628192337
732367406 733994895
796371835 798306228
496636511 498600178
946211536 947345154
866952254 868236697
743150932 ...

output:

impossible
367
impossible
impossible
105
3
impossible
12
impossible
impossible
8
impossible
108
impossible
impossible
impossible
126
impossible
impossible
impossible
impossible
impossible
251
impossible
impossible
impossible
impossible
impossible
277
54
impossible
impossible
50
impossible
34
impossi...

result:

ok 100000 lines

Test #39:

score: 0
Accepted
time: 42ms
memory: 17396kb

input:

100000 100000
92218679 95179758
317492416 320745639
733100351 736164573
961855441 965128977
837782167 840987990
17497768 20657218
448274654 451383491
900836773 903892815
285698089 288672515
717206068 720360660
350272947 353502098
539452749 542535367
320153387 323421078
549859328 552774077
407596307 ...

output:

317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
317
...

result:

ok 100000 lines

Test #40:

score: 0
Accepted
time: 64ms
memory: 18556kb

input:

100000 100000
744013029 744524903
471220871 471690214
120307805 120799735
926899213 927378946
753737949 754240556
361494837 361945312
133903676 134394731
330399973 330949740
34749028 35247553
430334132 430795521
362526758 363012637
266295097 266798513
702502851 703011578
848053622 848544848
78244603...

output:

impossible
685
impossible
1091
162
impossible
impossible
impossible
321
345
impossible
impossible
369
impossible
impossible
impossible
945
404
impossible
impossible
151
349
impossible
923
impossible
1194
654
impossible
impossible
impossible
333
89
975
1373
impossible
203
282
537
impossible
579
impos...

result:

ok 100000 lines

Subtask #6:

score: 0
Skipped

Dependency #1:

0%