QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#197319#7502. Painting the RoadswaifuSenpaiWA 7ms6160kbC++173.0kb2023-10-02 14:34:302023-10-02 14:34:31

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 4152kb

input:

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

output:

3
9
21
-1
42

result:

ok 5 number(s): "3 9 21 -1 42"

Test #2:

score: 0
Accepted
time: 6ms
memory: 3984kb

input:

1000
5 5
1 2 4 1
2 3 9 0
3 4 10 1
3 5 8 1
1 5 2 5 1
5 3
1 2 7 1
1 3 7 0
2 4 9 0
3 5 4 1
3 4 3
5 3
1 2 7 1
2 3 1 0
1 4 7 1
4 5 5 1
4 4 3
5 1
1 2 3 1
1 3 6 0
2 4 10 0
2 5 7 0
1
5 3
1 2 10 1
1 3 10 0
1 4 1 1
3 5 4 0
2 5 2
5 5
1 2 7 0
1 3 5 0
2 4 8 1
2 5 10 0
2 2 3 5 4
5 4
1 2 6 1
1 3 4 0
3 4 4 0
1 5 5 ...

output:

22
-1
19
3
11
8
11
7
8
0
10
1
1
7
5
28
12
-1
19
16
12
13
-1
32
9
18
16
14
10
12
16
0
11
-1
17
-1
9
14
27
8
11
-1
6
6
15
18
46
0
14
9
-1
5
8
22
-1
-1
17
-1
25
6
0
24
6
15
21
15
22
-1
6
0
65
20
5
28
20
0
20
19
18
-1
10
0
16
9
19
6
21
11
11
4
6
20
11
0
8
8
31
8
23
-1
8
-1
11
-1
9
13
-1
-1
19
9
20
19
6
...

result:

ok 1000 numbers

Test #3:

score: -100
Wrong Answer
time: 7ms
memory: 6160kb

input:

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

output:

47
-1
84
68
61
112
39
-1
-1
48
71
-1
-1
77
-1
-1
59
97
-1
-1
74
52
-1
-1
-1
74
48
-1
68
60
57
-1
85
68
-1
79
51
-1
33
48
62
-1
-1
113
84
44
-1
69
-1
56
64
-1
-1
110
42
40
39
81
-1
73
68
-1
74
125
67
44
-1
103
-1
-1
-1
89
64
-1
85
-1
50
-1
64
-1
-1
94
46
75
-1
-1
-1
101
67
61
-1
-1
18
100
28
102
-1
-...

result:

wrong answer 26th numbers differ - expected: '84', found: '74'