QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#349907#946. Magic Treehyforces#16 134ms44416kbC++202.5kb2024-03-10 08:10:182024-04-28 08:43:48

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 6
Accepted
time: 2ms
memory: 11648kb

input:

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

output:

7

result:

ok answer is '7'

Test #2:

score: -6
Wrong Answer
time: 0ms
memory: 11744kb

input:

20 19 20
1
1
2
1
3
6
5
1
5
8
1
10
3
7
4
16
13
4
2
14 13 1
18 9 1
15 16 1
9 20 1
4 18 1
12 15 1
2 6 1
16 13 1
5 5 1
17 19 1
7 4 1
11 14 1
8 3 1
10 1 1
20 16 1
13 1 1
6 4 1
3 12 1
19 20 1

output:

11

result:

wrong answer expected '12', found '11'

Subtask #2:

score: 3
Accepted

Test #10:

score: 3
Accepted
time: 55ms
memory: 22572kb

input:

100000 25000 100000
1
1
2
1
2
1
5
8
8
2
5
2
2
3
1
2
11
10
18
2
9
9
9
8
1
19
18
22
20
17
20
13
30
5
9
8
13
2
19
26
14
31
23
22
2
21
8
1
22
9
50
19
49
42
47
19
21
57
9
52
41
39
10
14
60
56
34
17
18
22
53
5
34
64
29
72
33
11
9
67
58
10
58
70
57
26
65
10
15
64
67
20
26
13
51
81
11
78
40
53
70
33
34
92
7...

output:

12471468294549

result:

ok answer is '12471468294549'

Test #11:

score: 0
Accepted
time: 53ms
memory: 25664kb

input:

100000 20000 100000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
9...

output:

10044081452141

result:

ok answer is '10044081452141'

Test #12:

score: 0
Accepted
time: 134ms
memory: 44416kb

input:

100000 90000 100000
1
1
1
1
1
1
1
1
8
1
1
8
11
11
4
4
8
11
4
4
11
4
8
8
24
4
23
4
4
11
23
11
11
1
24
24
11
23
23
23
4
24
24
11
8
11
24
23
8
24
50
1
24
23
4
24
1
4
1
11
11
50
57
23
23
54
53
55
61
23
69
54
67
11
69
24
75
23
1
53
75
1
75
1
75
50
55
61
57
55
55
23
89
8
55
11
77
89
11
24
61
23
1
75
89
67...

output:

44983082712726

result:

ok answer is '44983082712726'

Test #13:

score: 0
Accepted
time: 119ms
memory: 41676kb

input:

100000 90000 100000
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

45049819058025

result:

ok answer is '45049819058025'

Test #14:

score: 0
Accepted
time: 125ms
memory: 44068kb

input:

100000 90000 100000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
9...

output:

44931255444152

result:

ok answer is '44931255444152'

Subtask #3:

score: 0
Wrong Answer

Test #15:

score: 11
Accepted
time: 3ms
memory: 11424kb

input:

1000 500 1000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

3

result:

ok answer is '3'

Test #16:

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

input:

1000 500 1000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

38

result:

ok answer is '38'

Test #17:

score: -11
Wrong Answer
time: 3ms
memory: 12092kb

input:

1000 500 1000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

499

result:

wrong answer expected '500', found '499'

Subtask #4:

score: 0
Wrong Answer

Test #21:

score: 0
Wrong Answer
time: 80ms
memory: 24784kb

input:

100000 90000 2
1
1
3
2
1
2
1
5
1
8
11
9
1
8
12
7
1
2
7
6
12
9
16
18
13
10
23
27
26
17
23
10
24
11
21
13
30
1
11
6
13
8
30
15
17
34
39
41
32
29
27
17
21
12
26
33
10
50
29
17
46
33
21
28
47
26
3
67
38
5
10
45
61
70
59
17
46
40
20
58
67
68
15
62
71
71
57
32
81
18
66
7
14
51
67
92
86
38
88
60
45
54
5
59...

output:

22620643728092

result:

wrong answer expected '38521956905095', found '22620643728092'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%

Subtask #6:

score: 13
Accepted

Test #31:

score: 13
Accepted
time: 3ms
memory: 11192kb

input:

20000 800 60000
1
1
1
2
3
1
7
8
6
1
7
6
1
7
14
16
11
13
14
3
11
11
4
2
5
24
20
24
16
30
15
3
24
31
12
7
2
29
14
25
39
23
16
33
32
33
34
9
13
37
33
23
15
21
28
39
51
19
6
50
54
55
8
40
3
7
34
19
28
15
61
18
22
28
38
15
47
37
42
73
38
61
10
7
30
58
41
43
69
89
62
84
30
68
92
84
43
59
44
75
8
100
83
18...

output:

386917987664

result:

ok answer is '386917987664'

Test #32:

score: 0
Accepted
time: 29ms
memory: 17176kb

input:

100000 770 60000
1
2
3
3
2
2
4
7
9
9
3
11
6
6
13
12
4
4
7
11
20
17
1
22
15
1
10
21
9
23
31
22
12
24
16
26
29
9
36
13
8
5
41
38
34
19
31
29
13
32
11
39
38
32
26
38
39
29
38
6
49
59
3
9
18
38
42
20
38
11
45
8
68
19
51
66
53
7
26
35
56
60
35
32
45
57
45
27
64
49
46
64
13
64
4
49
32
22
45
67
67
62
70
10...

output:

372407653338

result:

ok answer is '372407653338'

Test #33:

score: 0
Accepted
time: 26ms
memory: 14384kb

input:

100000 770 90000
1
1
3
4
5
3
4
8
7
4
9
4
8
7
1
8
2
5
15
12
4
8
12
18
1
12
26
9
16
19
28
5
5
15
35
25
29
8
1
20
24
31
14
29
43
11
27
46
22
8
27
29
43
13
44
14
24
15
2
38
22
57
15
44
63
17
49
30
60
30
57
24
49
29
29
14
72
36
17
37
76
78
5
2
44
59
4
67
65
29
64
59
87
46
95
2
70
80
41
39
11
69
86
93
33
...

output:

391025345374

result:

ok answer is '391025345374'

Test #34:

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

input:

100000 1000 90000
1
2
3
1
3
3
4
6
3
5
5
3
9
3
12
14
2
6
15
2
15
14
14
8
12
7
26
13
12
23
15
1
29
2
11
34
18
26
37
23
23
26
12
9
3
32
31
38
33
21
50
25
50
24
9
51
6
9
15
5
8
25
39
3
17
42
21
54
50
25
37
59
42
16
43
15
55
43
79
17
67
57
26
19
46
86
87
9
56
7
65
31
86
11
64
72
38
71
44
86
76
66
58
83
5...

output:

479762613817

result:

ok answer is '479762613817'

Test #35:

score: 0
Accepted
time: 12ms
memory: 11308kb

input:

100000 1000 100000
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

505184101665

result:

ok answer is '505184101665'

Test #36:

score: 0
Accepted
time: 28ms
memory: 15520kb

input:

100000 1000 100000
1
2
2
3
4
2
6
1
6
8
3
11
2
6
11
13
12
12
11
19
1
12
2
17
21
26
25
27
28
25
30
8
8
29
28
26
12
11
3
32
6
2
21
41
35
25
29
8
46
12
26
46
28
19
25
26
6
45
32
59
29
50
61
28
61
6
2
63
69
19
8
1
66
30
12
17
2
69
66
27
41
63
59
35
79
74
86
41
13
11
29
1
4
46
11
25
69
11
88
87
17
88
3
10...

output:

335049254491

result:

ok answer is '335049254491'

Test #37:

score: 0
Accepted
time: 21ms
memory: 22416kb

input:

100000 1000 100000
1
2
2
4
5
3
7
6
8
10
10
12
13
9
15
8
16
18
9
19
12
21
14
24
23
26
10
25
27
29
3
31
4
18
33
30
37
33
36
40
38
29
42
41
44
45
27
47
5
46
49
52
51
51
55
53
56
58
59
60
4
9
61
57
65
64
66
67
59
69
52
24
68
74
71
75
33
77
76
79
80
82
81
5
83
45
84
88
89
77
90
86
71
92
95
93
97
96
98
10...

output:

136740610217

result:

ok answer is '136740610217'

Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

0%