QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#444320#4915. 海胆LeafSeek5 4ms42660kbC++144.4kb2024-06-15 18:17:142024-06-15 18:17:14

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 3ms
memory: 42612kb

input:

10
1 3
3 4
1 2
5 2
5 6
2 6
3 4
2 9
2 1
3 1
5
1 10
9 10
3 10
1 7
4 9

output:

4
0
3
3
1

result:

ok 5 number(s): "4 0 3 3 1"

Test #2:

score: 0
Accepted
time: 4ms
memory: 40492kb

input:

97
4 1
1 2
6 7
1 3
7 6
3 1
4 5
1 2
3 5
3 2
29 2
31 94
8 80
32 8
46 8
8 31
31 29
32 29
12 32
2 1
1 3
7 2
6 8
3 2
3 2
3 4
5 1
2 3
3 2
4 1
4 8
5 3
1 2
2 1
4 9
1 3
2 4
6 5
62 9
7 27
27 64
88 27
88 64
27 9
6 9
2 3
8 5
5 7
8 4
5 4
1 2
3 2
10 5
2 1
1 2
2 5
2 1
2 1
5 3
9 2
1 3
3 2
1 3
3 5
3 4
2 4
4 6
3 1
2 ...

output:

87
0
10
19
9
1
47
1
12
16
0
64
13
15
54
54
40
4
0
52
35
35
15
0
4
68
61
31
63
35
13
29
44
21
27
2
13
50
0
48
35
73
1
42
35
42
68
48
8
3
44
40
27
52
54
24
3
0
20
21
14
35
2
9
22
70
5
39
16
0
55
43
14
22
20
47
55
48
22
31
25
4
42
0
26
21
51
42
35
27
24
34
44
8
51
36

result:

ok 96 numbers

Test #3:

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

input:

99
4 3
8 9
1 2
28 21
21 28
72 40
85 80
99 75
73 47
42 47
42 73
47 27
3 5
3 2
65 22
2 3
75 35
76 55
85 81
95 63
75 35
30 58
61 69
68 87
56 21
23 97
53 47
40 47
54 91
39 32
32 54
47 91
96 61
15 60
96 43
60 96
96 60
99 60
34 87
68 56
29 16
37 77
83 2
71 70
96 89
37 30
26 8
45 88
68 27
46 57
51 57
8 27
...

output:

19
4
2
3
13
8
5
13
0
4
2
13
19
0
4
8
5
6
1
2
3
3
15
3
15
2
2
7
0
11
0
5
4
16
2
11
12
0
15
15
11
0
8
10
2
2
4
2
5
7
8
3
3
0
12
14
11
11
6
2
14
5
0
1
12
8
2
0
8
4
11
4
14
5
13
11
7
2
14
2
4
14
5
6
12
3
3
1
14
2
8
12
0
5
13

result:

ok 95 numbers

Test #4:

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

input:

99
4 7
4 5
5 3
1 2
1 2
4 3
4 2
1 2
10 5
4 7
5 2
8 7
38 62
52 8
80 98
21 19
94 7
80 49
21 79
94 49
21 7
80 79
3 1
4 7
6 3
35 95
41 94
95 41
94 35
98 35
3 1
2 5
2 1
2 1
3 2
1 2
10 9
3 7
1 3
4 3
9 7
4 7
1 2
3 4
3 1
2 7
1 4
10 8
2 1
3 8
5 1
4 2
4 3
3 2
7 9
5 7
3 1
4 5
2 3
6 5
1 2
1 7
4 3
3 6
2 3
3 1
8 4...

output:

73
21
65
22
21
2
54
8
4
47
30
39
4
0
18
14
1
40
0
27
4
2
0
15
0
60
40
0
0
4
8
11
49
46
1
12
32
5
1
33
24
0
6
16
7
3
5
0
0
13
49
34
8
12
32
55
0
22
39
59
0
31
60
21
25
2
9
59
23
9
31
17
16
0
17
52
59
42
23
45
0
62
63
3
5
0
38
19
40
32
10
53
8
1
8
0
8
13

result:

ok 98 numbers

Test #5:

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

input:

100
5 6
3 5
1 6
1 4
6 5
9 6
2 4
7 2
1 2
78 17
68 78
68 17
16 17
5 1
2 3
4 1
98 54
97 20
62 98
81 62
20 95
95 81
97 98
2 1
2 7
8 5
3 6
5 1
2 7
8 7
2 6
4 8
1 3
1 3
2 1
4 1
1 2
87 29
51 38
87 51
51 87
28 87
71 12
71 12
3 1
1 2
2 4
2 4
3 1
38 59
15 38
15 74
74 59
81 59
2 6
9 5
94 65
59 14
59 18
18 65
14...

output:

68
36
18
30
43
17
2
33
13
16
33
0
8
24
37
19
21
0
2
49
0
24
42
23
36
28
0
56
13
30
0
29
19
5
0
20
3
12
9
4
38
30
38
40
9
0
6
25
33
19
26
4
38
37
21
12
48
17
40
6
12
2
33
22
28
53
63
28
0
36
26
19
25
3
64
13
2
0
2
28
2
17
11
2
34
30
29
40
4
14
22
38
5
26
52
22
2
42
42
15

result:

ok 100 numbers

Test #6:

score: 0
Accepted
time: 3ms
memory: 42660kb

input:

100
6 3
2 1
2 8
1 10
1 3
2 1
1 3
1 2
4 2
3 5
5 1
8 18
18 29
18 29
6 5
3 6
4 2
2 1
4 3
10 2
3 1
3 2
2 3
31 91
1 4
42 31
91 67
42 67
21 67
67 73
2 1
7 8
3 1
1 5
2 1
3 2
4 3
3 5
9 3
65 44
87 44
2 8
1 6
33 44
2 4
3 9
1 3
6 7
5 8
16 44
16 65
44 86
16 44
73 5
18 73
18 44
5 16
16 30
57 16
64 73
18 59
2 1
8...

output:

60
4
21
49
0
14
16
0
0
17
38
51
0
38
2
1
5
32
27
5
33
2
21
8
34
19
0
60
3
1
37
28
6
54
1
0
24
9
0
45
22
18
36
56
30
16
1
4
2
4
12
19
27
0
31
53
0
10
14
0
2
26
0
0
2
29
26
41
5
2
19
20
14
4
20
10
30
58
18
1
11
32
0
26
2
0
0
23
0
0
0
28
37
9
0
20
18
6
45
41

result:

ok 100 numbers

Subtask #2:

score: 0
Runtime Error

Dependency #1:

100%
Accepted

Test #7:

score: 0
Runtime Error

input:

498
1 2
185 374
112 96
1 5
1 2
32 63
151 32
436 196
242 2
269 186
288 277
109 165
360 493
394 414
29 435
21 436
310 98
29 317
397 32
400 485
394 248
471 288
438 40
109 394
284 268
112 75
493 437
176 493
432 185
259 286
391 485
242 155
227 256
1 397
423 155
149 310
471 308
331 358
269 436
242 149
244...

output:


result:


Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Runtime Error

Test #22:

score: 0
Runtime Error

input:

1000000
1 2
1 4
2 1
3 6
6 5
1 3
10 5
2 4
9 6
3 2
1 2
5 1
4 3
1 3
1 4
2 9
6 4
1 2
1 2
1 2
3 4
3 4
7 5
1 2
1 2
2 1
7 8
1 2
5 4
1 3
2 1
4 2
1 4
1 4
4 2
1 3
1 3
7 4
3 4
3 2
2 1
1 2
1 2
2 5
10 6
2 3
2 5
7 2
5 4
4 5
5 7
2 1
8 5
2 1
2 1
1 3
4 6
3 1
2 5
4 8
6 3
1 4
1 2
1 3
9 8
6 5
3 4
3 2
1 3
4 2
1 6
2 1
1 ...

output:


result:


Subtask #6:

score: 0
Time Limit Exceeded

Test #27:

score: 0
Time Limit Exceeded

input:

1000000
194603 719066
675018 226509
79442 45350
917512 353429
61308 216895
411878 891116
152492 299355
285259 500703
362450 305858
809620 298590
353068 307896
594296 243696
962716 546635
865529 461074
454115 255260
569303 319052
266164 139614
575510 107514
840723 802795
583117 41941
891173 661899
94...

output:


result:


Subtask #7:

score: 0
Skipped

Dependency #4:

0%