QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#442898#8584. 바이러스HuangHanSheng0 2ms4012kbC++232.7kb2024-06-15 13:47:142024-06-15 13:47:15

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Memory Limit Exceeded

Test #1:

score: 5
Accepted
time: 0ms
memory: 3548kb

input:

8 5
0 1
1 2
2 3
3 4
4 5
5 6
6 7
2 2
5 0
7 0
1 1
4 1
40 5 5 16 32 8 1 10

output:

0
24
-1
5
16

result:

ok 5 lines

Test #2:

score: 5
Accepted
time: 2ms
memory: 3492kb

input:

1 2
0 0
0 0
1000000000

output:

0
1000000000

result:

ok 2 lines

Test #3:

score: 5
Accepted
time: 1ms
memory: 3508kb

input:

1 1
0 0
1

output:

0

result:

ok single line: '0'

Test #4:

score: 5
Accepted
time: 0ms
memory: 3860kb

input:

5 5
0 1
1 2
2 3
3 4
4 4
3 4
3 4
4 4
3 3
205776802 419505279 604355565 320588676 267287300

output:

0
205776802
205776802
205776802
205776802

result:

ok 5 lines

Test #5:

score: 5
Accepted
time: 1ms
memory: 3604kb

input:

5 5
0 1
1 2
2 3
3 4
0 1
2 4
3 2
2 2
0 3
798595430 17544794 263282020 749935522 265537216

output:

0
17544794
17544794
17544794
17544794

result:

ok 5 lines

Test #6:

score: 5
Accepted
time: 1ms
memory: 3604kb

input:

5 5
0 1
1 2
2 3
3 4
4 0
3 0
0 0
1 1
1 0
805814316 68727170 931548944 955566578 268585692

output:

0
-1
-1
-1
-1

result:

ok 5 lines

Test #7:

score: 5
Accepted
time: 0ms
memory: 3632kb

input:

5 5
0 1
1 2
2 3
3 4
3 4
0 4
2 4
2 4
2 4
140258399 508694682 846494800 923720900 238592045

output:

0
140258399
140258399
140258399
140258399

result:

ok 5 lines

Test #8:

score: 5
Accepted
time: 0ms
memory: 3668kb

input:

10 10
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
8 7
3 7
9 8
0 5
5 7
4 3
2 9
6 9
7 8
4 8
998183090 584072254 887174893 11448861 742483923 59447072 545713676 980826811 811598242 35544321

output:

0
11448861
11448861
11448861
11448861
11448861
11448861
11448861
11448861
11448861

result:

ok 10 lines

Test #9:

score: 5
Accepted
time: 2ms
memory: 3620kb

input:

10 10
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
2 5
5 4
9 5
2 9
5 2
6 4
2 4
8 4
9 7
2 0
911698130 382043019 90722009 440968421 571375991 137522383 377189267 211855539 341720684 687999451

output:

0
90722009
137522383
90722009
137522383
90722009
90722009
137522383
90722009
90722009

result:

ok 10 lines

Test #10:

score: 5
Accepted
time: 0ms
memory: 3576kb

input:

10 10
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
3 3
2 5
0 4
3 2
5 1
1 0
4 2
8 0
3 2
3 0
892608355 903586083 572266475 47500884 6301829 729660024 455211808 942317353 131889193 801254776

output:

0
6301829
6301829
6301829
6301829
903586083
6301829
-1
6301829
47500884

result:

ok 10 lines

Test #11:

score: 5
Accepted
time: 1ms
memory: 3592kb

input:

10 10
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
0 9
9 9
4 9
0 9
7 9
8 9
0 9
6 9
5 9
4 9
95389682 395000358 484533614 652845161 327306317 799690376 871884048 751786316 693371321 784309957

output:

0
95389682
95389682
95389682
95389682
95389682
95389682
95389682
95389682
95389682

result:

ok 10 lines

Test #12:

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

input:

20 20
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
2 12
0 12
5 17
7 14
6 16
1 19
13 18
6 14
4 9
0 18
18 18
6 11
0 13
15 17
1 8
6 18
9 9
13 16
6 19
2 15
436523225 735146636 641656461 569341995 381628222 450451359 605334108 99712125 988489106 717299297...

output:

0
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125
99712125

result:

ok 20 lines

Test #13:

score: 5
Accepted
time: 1ms
memory: 3632kb

input:

20 20
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
13 3
6 4
16 1
19 19
19 17
5 2
5 7
12 7
6 18
12 11
18 11
11 5
13 13
15 19
19 3
9 7
16 7
16 6
5 7
8 9
999021218 83246177 270836731 525612430 672541663 476653247 839288054 764153704 941216586 648134044 ...

output:

0
348015639
499890278
77178908
77178908
553832155
160425085
77178908
77178908
77178908
77178908
77178908
77178908
77178908
300536180
77178908
77178908
77178908
160425085
77178908

result:

ok 20 lines

Test #14:

score: 5
Accepted
time: 1ms
memory: 3588kb

input:

20 20
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
12 8
12 4
19 3
8 0
12 0
16 0
4 0
12 1
3 3
9 6
11 5
6 7
14 9
8 5
15 2
8 5
8 2
0 2
18 3
16 7
346014551 491695164 57622712 97722771 993912839 996909253 733512353 277580504 195751201 438876633 523544328 ...

output:

0
195751201
519350473
195751201
377943706
519350473
993912839
377943706
253373913
195751201
195751201
195751201
195751201
195751201
519350473
195751201
195751201
253373913
519350473
377943706

result:

ok 20 lines

Test #15:

score: 5
Accepted
time: 0ms
memory: 3696kb

input:

20 20
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
7 19
5 19
8 19
17 19
14 19
19 19
15 19
14 19
12 19
15 19
9 19
1 19
0 19
2 19
8 19
8 19
4 19
8 19
13 19
1 19
69882800 452312168 666117339 829711627 782632700 231822906 990022913 818955019 160583703 53...

output:

0
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683
2957683

result:

ok 20 lines

Test #16:

score: 0
Memory Limit Exceeded

input:

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

output:

0
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
15461593
5660055
9594340
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
5660055
18867951
5660055
...

result:


Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Memory Limit Exceeded

Test #34:

score: 5
Accepted
time: 0ms
memory: 3564kb

input:

8 5
0 1
1 2
2 3
3 4
4 5
3 6
3 7
2 2
5 0
7 0
1 1
4 1
40 5 5 16 32 8 1 10

output:

0
24
10
5
16

result:

ok 5 lines

Test #35:

score: 5
Accepted
time: 1ms
memory: 3864kb

input:

10 10
9 3
0 6
1 8
5 1
3 2
8 7
0 4
6 5
0 9
9 0
7 2
1 0
8 1
6 3
1 2
4 6
7 2
5 1
5 4
10 12 5 9 8 21 20 6 13 5

output:

0
11
17
11
5
11
5
11
17
5

result:

ok 10 lines

Test #36:

score: 5
Accepted
time: 2ms
memory: 4012kb

input:

20 20
16 11
13 10
17 6
13 18
13 16
13 0
2 5
14 7
5 17
15 1
18 19
7 15
6 4
13 2
1 8
0 14
13 12
13 9
9 3
10 9
5 16
8 18
0 19
17 16
7 11
2 7
15 13
18 18
19 11
2 18
16 7
11 17
16 19
14 15
5 15
13 19
5 8
7 15
17 15
201842345 959136634 799276472 790823713 190419998 931723392 553266463 967187391 208167145 ...

output:

0
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910
134949910

result:

ok 20 lines

Test #37:

score: 5
Accepted
time: 1ms
memory: 3624kb

input:

20 20
11 17
13 8
6 4
18 13
15 12
5 15
16 7
8 10
3 18
16 3
16 19
16 1
2 9
1 11
14 2
0 14
10 5
16 0
17 6
0 1
17 5
1 14
16 6
1 5
4 3
4 4
18 4
12 8
7 8
0 12
3 12
4 13
11 5
2 0
10 9
18 1
18 17
15 19
11 4
392505795 598245226 676917494 520541066 400541959 961423871 653272803 503778194 808079532 53571674 86...

output:

0
392505795
392505795
392505795
392505795
793047754
793047754
392505795
395420842
392505795
392505795
392505795
392505795
392505795
1069423289
392505795
395420842
392505795
392505795
392505795

result:

ok 20 lines

Test #38:

score: 5
Accepted
time: 1ms
memory: 3628kb

input:

20 20
1 13
3 12
0 8
2 4
8 5
10 17
10 0
10 11
13 16
19 9
6 18
10 14
10 2
7 1
5 6
4 15
11 3
9 7
10 19
4 4
7 2
1 0
9 1
3 1
10 15
18 0
6 3
19 8
15 0
16 5
15 5
4 10
0 0
14 1
9 10
17 11
17 0
12 4
13 6
32588836 700122468 935315183 460144664 72259535 979008218 991710456 656707652 436761227 637241986 4232798...

output:

0
362671255
732711304
537602043
176293815
32588836
516986682
32588836
32588836
149603530
362671255
32588836
32588836
32588836
219213726
32588836
32588836
378798728
32588836
32588836

result:

ok 20 lines

Test #39:

score: 5
Accepted
time: 1ms
memory: 3820kb

input:

20 20
17 7
12 3
15 0
17 6
7 12
10 16
2 15
17 1
17 4
14 19
17 5
0 9
17 2
18 14
4 10
19 13
9 18
3 11
11 8
3 19
13 19
4 19
6 19
4 19
9 19
2 19
15 19
3 19
15 19
13 19
9 19
4 19
11 19
10 19
3 19
12 19
17 19
7 19
15 19
601569352 457345748 950690477 940932136 419713541 265386030 296609107 328433361 2843618...

output:

0
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849
71625849

result:

ok 20 lines

Test #40:

score: 0
Memory Limit Exceeded

input:

500 500
61 206
219 174
496 451
386 483
285 100
385 54
98 441
455 305
40 443
496 139
88 374
462 27
426 92
259 245
155 262
205 223
29 190
496 33
54 120
93 182
167 350
23 211
147 429
463 41
372 354
31 465
461 258
117 433
149 21
27 322
240 387
498 202
261 279
233 315
485 68
389 390
256 82
91 405
350 370...

output:

0
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
770946
7709...

result:


Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

0%