QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#274309#7600. Minimums on the EdgesZhaoZiLongWA 355ms85476kbC++173.5kb2023-12-03 14:05:202023-12-03 14:05:21

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4 4 6
1 2
2 3
3 1
1 4

output:

2 2 2 0 

result:

ok answer = 6

Test #2:

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

input:

3 7 7
1 2
1 2
1 2
1 3
1 3
2 3
2 3

output:

2 2 3 

result:

ok answer = 14

Test #3:

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

input:

5 10 61
5 3
1 2
4 5
2 3
2 1
3 1
1 5
3 5
2 4
2 1

output:

15 15 15 1 15 

result:

ok answer = 122

Test #4:

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

input:

5 10 6
1 4
3 4
4 3
1 4
5 1
4 3
3 2
1 3
5 2
2 3

output:

2 0 2 2 0 

result:

ok answer = 12

Test #5:

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

input:

5 10 85
3 1
4 5
4 1
4 5
1 5
2 3
4 5
1 4
3 2
2 3

output:

17 17 17 17 17 

result:

ok answer = 170

Test #6:

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

input:

5 10 30
2 5
2 4
4 5
4 3
5 1
4 3
2 3
1 5
1 4
2 1

output:

6 6 6 6 6 

result:

ok answer = 60

Test #7:

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

input:

5 10 77
1 3
4 1
4 3
5 2
5 2
2 5
2 3
3 4
5 3
5 2

output:

0 38 1 0 38 

result:

ok answer = 154

Test #8:

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

input:

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

output:

0 0 0 0 1 1 1 1 0 0 

result:

ok answer = 1415

Test #9:

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

input:

10 10000 83
7 9
6 4
3 6
7 5
2 5
10 7
10 7
7 10
6 5
3 9
2 6
9 10
8 2
6 2
10 1
3 9
4 2
9 5
2 10
6 3
10 5
5 9
6 2
1 4
8 9
7 6
2 5
7 8
10 4
2 1
2 9
7 10
2 7
2 5
9 10
10 8
4 1
10 8
2 5
3 10
6 7
6 3
5 8
10 2
6 10
6 3
9 5
6 2
8 5
8 2
8 10
2 8
5 10
5 2
10 3
8 6
3 1
3 2
8 7
3 7
8 2
9 7
5 9
5 3
7 5
2 6
6 9
8 ...

output:

8 8 8 8 8 8 9 8 9 9 

result:

ok answer = 80726

Test #10:

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

input:

10 10000 28
8 3
7 5
10 9
6 2
1 9
4 7
4 7
7 1
10 6
10 5
5 3
8 3
3 1
3 1
8 1
4 7
5 6
4 10
3 2
4 8
2 4
9 7
8 7
10 9
9 10
2 1
6 1
7 1
2 8
5 10
1 4
5 8
1 3
8 3
4 3
9 2
5 1
4 6
10 1
10 2
5 4
9 3
10 2
5 9
2 1
7 4
1 8
4 8
3 9
9 6
3 6
5 1
2 7
4 3
2 8
8 10
1 7
4 1
3 9
1 2
1 9
8 4
9 5
1 5
6 4
1 6
6 7
2 7
10 4
...

output:

3 3 3 2 3 2 3 3 3 3 

result:

ok answer = 26312

Test #11:

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

input:

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

output:

1 0 1 1 0 0 1 0 1 1 

result:

ok answer = 3460

Test #12:

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

input:

10 10000 19
1 3
6 7
4 5
9 8
5 8
1 9
10 7
10 6
2 9
2 5
2 4
2 3
3 2
9 3
3 9
7 10
7 8
7 1
8 6
8 9
1 5
2 5
4 6
2 10
8 9
8 2
6 7
9 10
1 2
3 10
5 6
8 5
5 9
3 4
4 10
5 3
8 9
6 1
4 2
2 5
2 9
2 10
1 9
9 4
10 2
8 4
9 1
7 8
1 2
6 10
8 2
8 10
5 4
10 9
7 2
3 2
6 8
5 4
8 9
8 10
6 8
10 4
7 3
3 5
9 8
6 7
5 3
5 8
2 ...

output:

2 2 2 2 2 2 2 2 1 2 

result:

ok answer = 18048

Test #13:

score: 0
Accepted
time: 308ms
memory: 85360kb

input:

18 15 22
8 17
13 14
5 15
2 17
18 1
17 10
1 5
6 18
1 6
11 2
15 17
2 13
4 3
1 10
16 14

output:

3 0 0 0 3 3 0 1 0 3 0 0 0 0 3 0 3 3 

result:

ok answer = 25

Test #14:

score: 0
Accepted
time: 331ms
memory: 85356kb

input:

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

output:

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok answer = 0

Test #15:

score: 0
Accepted
time: 328ms
memory: 85400kb

input:

18 15 47
12 9
11 9
9 3
12 2
13 2
3 11
9 12
17 2
15 7
10 9
8 15
5 4
10 13
8 9
12 16

output:

0 6 7 0 0 0 0 0 7 6 7 7 6 0 0 1 0 0 

result:

ok answer = 60

Test #16:

score: 0
Accepted
time: 320ms
memory: 85352kb

input:

18 15 25
6 5
17 14
12 16
16 13
11 12
16 11
17 15
11 18
15 17
8 17
7 15
3 8
6 5
10 16
7 6

output:

0 0 0 0 5 5 5 0 0 0 0 0 0 0 5 0 5 0 

result:

ok answer = 30

Test #17:

score: 0
Accepted
time: 321ms
memory: 85408kb

input:

18 15 38
1 18
8 3
15 11
5 6
8 4
8 12
16 11
13 5
14 17
1 11
5 2
15 18
6 3
1 16
15 4

output:

8 0 0 0 0 0 0 0 0 0 8 0 0 0 7 8 0 7 

result:

ok answer = 45

Test #18:

score: 0
Accepted
time: 298ms
memory: 85360kb

input:

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

output:

3 4 3 3 4 4 4 3 3 3 3 4 0 3 0 3 4 0 

result:

ok answer = 90

Test #19:

score: 0
Accepted
time: 322ms
memory: 85472kb

input:

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

output:

2 2 2 0 2 2 2 2 2 2 0 2 2 0 1 2 2 2 

result:

ok answer = 53

Test #20:

score: 0
Accepted
time: 339ms
memory: 85408kb

input:

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

output:

0 3 3 3 0 3 3 3 3 3 3 3 0 3 3 3 0 3 

result:

ok answer = 72

Test #21:

score: 0
Accepted
time: 306ms
memory: 85476kb

input:

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

output:

0 1 2 1 0 2 2 0 1 2 1 1 2 2 1 0 0 2 

result:

ok answer = 38

Test #22:

score: 0
Accepted
time: 337ms
memory: 85388kb

input:

18 30 66
3 17
2 6
13 17
11 16
17 13
16 10
10 11
16 15
6 3
14 2
3 8
5 9
7 11
15 7
17 15
14 18
1 3
10 1
4 15
5 17
11 5
18 13
13 10
11 17
16 17
5 7
13 7
10 5
10 16
18 8

output:

1 0 1 0 8 0 8 0 0 8 8 0 8 0 8 8 8 0 

result:

ok answer = 147

Test #23:

score: 0
Accepted
time: 355ms
memory: 85412kb

input:

18 100000 55
8 2
4 15
6 2
4 3
10 15
18 9
10 12
1 6
17 3
18 13
11 5
3 4
17 2
10 5
15 2
15 12
14 9
11 3
10 6
5 7
5 16
10 14
2 12
12 11
4 8
12 5
2 9
11 18
15 14
13 7
18 5
7 16
7 12
17 10
18 14
8 5
9 5
2 13
1 9
14 18
4 2
13 5
7 11
14 15
5 12
2 1
6 13
13 3
12 2
9 1
4 8
17 13
2 17
15 18
4 5
18 10
12 16
14...

output:

3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 

result:

ok answer = 300000

Test #24:

score: 0
Accepted
time: 317ms
memory: 85400kb

input:

18 100000 33
4 14
11 2
17 6
10 12
1 12
2 15
17 5
14 18
17 3
10 13
2 8
12 6
12 5
16 15
3 9
5 12
5 9
3 4
9 18
15 1
4 6
8 15
3 11
5 1
11 3
9 3
14 7
3 1
13 16
17 18
18 7
10 1
1 7
11 3
10 16
6 1
7 5
18 2
9 16
12 2
9 14
8 18
7 13
13 8
4 15
16 13
18 11
13 5
2 4
3 12
4 5
2 9
10 14
11 13
13 11
16 1
5 3
15 13...

output:

2 2 2 2 1 2 2 1 2 2 2 2 2 2 2 1 2 2 

result:

ok answer = 169113

Test #25:

score: 0
Accepted
time: 346ms
memory: 85432kb

input:

18 100000 79
15 10
2 9
2 1
16 5
17 4
14 16
17 3
16 6
16 1
3 7
17 14
7 15
12 6
12 7
6 15
16 1
11 14
2 6
16 11
14 11
6 3
1 12
5 1
13 9
16 10
15 4
18 11
14 10
16 10
9 16
3 2
10 14
5 6
15 1
17 7
11 7
1 15
16 6
3 8
6 14
16 7
8 17
3 9
3 16
3 6
18 13
8 9
12 14
7 6
14 7
4 14
15 8
2 18
10 6
8 16
17 18
7 1
7 ...

output:

5 4 4 4 4 4 5 4 4 5 4 4 5 4 4 5 5 5 

result:

ok answer = 414155

Test #26:

score: 0
Accepted
time: 329ms
memory: 85364kb

input:

18 100000 57
8 7
8 16
3 12
2 16
16 14
7 18
16 17
17 9
15 18
14 16
15 2
1 8
14 6
7 18
11 4
11 8
1 3
15 16
14 13
15 4
6 14
4 12
17 16
5 4
17 15
5 16
17 16
14 5
16 3
13 1
15 5
1 10
12 4
13 18
13 14
5 12
5 16
17 12
14 1
4 15
8 16
4 13
17 2
15 3
10 16
17 3
6 5
12 9
3 9
14 11
13 15
1 2
3 16
1 17
13 15
14 ...

output:

3 3 3 3 3 4 3 3 3 3 3 3 4 3 3 3 4 3 

result:

ok answer = 302082

Test #27:

score: 0
Accepted
time: 344ms
memory: 85432kb

input:

18 100000 70
2 3
17 5
6 7
12 7
1 18
16 15
1 15
13 15
7 10
14 7
13 1
13 7
3 10
16 10
6 16
3 5
7 1
16 12
18 17
4 3
15 17
5 6
1 3
12 7
1 13
13 15
17 14
13 10
6 12
14 16
17 2
4 17
13 12
4 17
15 10
9 11
15 18
10 3
12 15
6 9
3 10
9 5
10 1
4 12
11 10
18 1
9 7
2 10
4 12
4 1
11 1
16 11
17 15
2 14
13 11
12 7
...

output:

4 4 4 3 4 3 4 4 4 4 4 4 4 4 4 4 4 4 

result:

ok answer = 378879

Test #28:

score: 0
Accepted
time: 345ms
memory: 85476kb

input:

18 1950 23
1 2
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
1 2
1 2
1 2
2 1
1 2
1 2
1 2
2 1
2 1
2 1
1 2
2 1
1 2
1 2
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
1 2
1 2
1 2
2 1
1 2
2 1
1 2
2 1
1 2
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2...

output:

2 2 2 2 2 2 2 2 2 2 0 2 1 0 0 0 0 0 

result:

ok answer = 2851

Test #29:

score: 0
Accepted
time: 336ms
memory: 85432kb

input:

18 1950 58
2 1
1 2
2 1
2 1
1 2
2 1
2 1
1 2
2 1
1 2
2 1
1 2
1 2
2 1
1 2
1 2
2 1
1 2
1 2
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
1 2
2 1
2 1
1 2
2 1
1 2
1 2
1 2
2 1
2 1
1 2
2 1
1 2
2 1
1 2
1 2
2 1
2 1
2 1
1 2
1 2
1 2
2 1
1 2
1 2
1 2
1 2
1 2
1 2
1 2
2 1
2 1
2 1
2 1
1 2
2 1
2 1
1 2
1 2
1 2
2 1
2 1
1...

output:

4 4 4 4 4 4 4 4 4 4 4 3 4 3 4 0 0 0 

result:

ok answer = 7479

Test #30:

score: 0
Accepted
time: 325ms
memory: 85412kb

input:

18 1950 66
1 2
2 1
1 2
1 2
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
1 2
1 2
1 2
2 1
1 2
2 1
2 1
1 2
1 2
1 2
2 1
1 2
2 1
1 2
2 1
1 2
1 2
2 1
1 2
2 1
2 1
2 1
1 2
1 2
2 1
2 1
1 2
1 2
1 2
2 1
2 1
1 2
2 1
2 1
2 1
1 2
1 2
2 1
1 2
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
1 2
1 2
2 1
2 1
1 2
2 1
2 1
1 2
1 2
1...

output:

5 5 5 5 5 4 4 5 4 4 4 4 4 4 4 0 0 0 

result:

ok answer = 8450

Test #31:

score: 0
Accepted
time: 338ms
memory: 85368kb

input:

18 1950 92
1 2
1 2
2 1
2 1
1 2
1 2
2 1
2 1
1 2
2 1
1 2
1 2
2 1
1 2
2 1
1 2
1 2
2 1
1 2
1 2
2 1
1 2
2 1
2 1
1 2
2 1
2 1
1 2
1 2
2 1
1 2
1 2
1 2
2 1
2 1
1 2
2 1
1 2
1 2
2 1
1 2
1 2
2 1
1 2
2 1
2 1
2 1
2 1
1 2
2 1
2 1
1 2
1 2
2 1
2 1
1 2
1 2
1 2
1 2
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
1 2
2 1
2...

output:

7 7 6 6 6 6 6 6 6 6 6 6 6 6 6 0 0 0 

result:

ok answer = 11900

Test #32:

score: -100
Wrong Answer
time: 343ms
memory: 85348kb

input:

18 1950 87
1 2
1 2
1 2
2 1
2 1
1 2
1 2
2 1
2 1
1 2
2 1
2 1
2 1
1 2
1 2
1 2
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
1 2
2 1
1 2
1 2
1 2
2 1
1 2
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
1 2
2 1
1 2
2 1
1 2
2 1
2 1
1 2
1 2
1 2
1 2
1 2
2 1
1 2
2 1
1 2
1 2
1 2
2 1
2 1
2 1
2 1
1 2
1 2
2 1
1 2
1 2
2...

output:

6 6 6 6 6 6 6 6 6 6 6 5 5 6 5 0 0 0 

result:

wrong answer jury has the better answer: jans = 11247, pans = 11233