QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#59491#3479. Lights OutLHWA 2755ms444188kbJava114.8kb2022-10-29 17:11:192022-10-29 17:12:14

詳細信息

Test #1:

score: 100
Accepted
time: 757ms
memory: 301484kb

input:

6 5 7
0 2
2 3
3 4
3 5
1 2
1 2 0 1
1 2 1 2
2 2 2 3
3 2 3 4
4 2 4 5
4 2 0 5
5 2 0 3

output:

7

result:

ok single line: '7'

Test #2:

score: 0
Accepted
time: 833ms
memory: 301332kb

input:

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

output:

17

result:

ok single line: '17'

Test #3:

score: 0
Accepted
time: 860ms
memory: 300080kb

input:

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

output:

10

result:

ok single line: '10'

Test #4:

score: 0
Accepted
time: 765ms
memory: 301448kb

input:

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

output:

12

result:

ok single line: '12'

Test #5:

score: 0
Accepted
time: 854ms
memory: 299912kb

input:

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

output:

24

result:

ok single line: '24'

Test #6:

score: 0
Accepted
time: 835ms
memory: 299148kb

input:

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

output:

14

result:

ok single line: '14'

Test #7:

score: 0
Accepted
time: 849ms
memory: 300424kb

input:

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

output:

17

result:

ok single line: '17'

Test #8:

score: 0
Accepted
time: 873ms
memory: 299636kb

input:

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

output:

10

result:

ok single line: '10'

Test #9:

score: 0
Accepted
time: 788ms
memory: 299208kb

input:

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

output:

19

result:

ok single line: '19'

Test #10:

score: 0
Accepted
time: 761ms
memory: 299904kb

input:

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

output:

4

result:

ok single line: '4'

Test #11:

score: 0
Accepted
time: 943ms
memory: 300348kb

input:

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

output:

7

result:

ok single line: '7'

Test #12:

score: 0
Accepted
time: 825ms
memory: 300512kb

input:

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

output:

7

result:

ok single line: '7'

Test #13:

score: 0
Accepted
time: 853ms
memory: 299064kb

input:

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

output:

8

result:

ok single line: '8'

Test #14:

score: 0
Accepted
time: 736ms
memory: 303424kb

input:

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

output:

7

result:

ok single line: '7'

Test #15:

score: 0
Accepted
time: 837ms
memory: 302656kb

input:

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

output:

6

result:

ok single line: '6'

Test #16:

score: 0
Accepted
time: 812ms
memory: 302512kb

input:

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

output:

11

result:

ok single line: '11'

Test #17:

score: 0
Accepted
time: 957ms
memory: 302884kb

input:

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

output:

19

result:

ok single line: '19'

Test #18:

score: 0
Accepted
time: 835ms
memory: 302540kb

input:

2 1 1
0 1
0 1 1

output:

2

result:

ok single line: '2'

Test #19:

score: 0
Accepted
time: 749ms
memory: 302204kb

input:

2 1 100
0 1
0 1 0
1 1 0
1 2 0 1
1 1 1
1 1 0
1 1 0
0 2 1 0
1 2 1 0
1 2 1 0
1 2 0 1
0 1 0
0 1 1
0 1 0
0 2 1 0
0 2 0 1
1 2 1 0
1 2 0 1
0 1 0
1 2 0 1
0 2 0 1
0 2 0 1
1 1 0
1 2 0 1
0 2 1 0
0 1 1
1 2 1 0
1 2 1 0
1 1 0
0 2 1 0
1 1 1
1 1 1
1 1 1
1 2 1 0
0 1 1
1 2 0 1
1 2 0 1
0 2 1 0
0 2 0 1
0 1 1
1 1 0
1 2 ...

output:

2

result:

ok single line: '2'

Test #20:

score: 0
Accepted
time: 797ms
memory: 302780kb

input:

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

output:

7

result:

ok single line: '7'

Test #21:

score: 0
Accepted
time: 2755ms
memory: 444188kb

input:

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

output:

38

result:

ok single line: '38'

Test #22:

score: 0
Accepted
time: 787ms
memory: 303376kb

input:

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

output:

38

result:

ok single line: '38'

Test #23:

score: 0
Accepted
time: 866ms
memory: 302596kb

input:

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

output:

38

result:

ok single line: '38'

Test #24:

score: 0
Accepted
time: 812ms
memory: 302748kb

input:

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

output:

3

result:

ok single line: '3'

Test #25:

score: 0
Accepted
time: 805ms
memory: 301880kb

input:

12 22 36
3 8
2 0
0 1
7 10
7 3
4 7
9 7
7 8
1 5
8 5
8 11
4 5
10 9
11 5
0 5
6 7
9 2
8 2
3 1
10 4
5 7
2 5
7 2 1 8
9 4 7 8 5 3
4 8 6 10 3 9 11 4 7 2
9 7 2 7 0 8 4 3 6
5 7 9 1 11 0 8 5 4
4 6 7 0 8 11 9 4
0 2 1 5
4 7 2 7 3 5 10 11 8
5 12 4 0 10 8 3 9 1 5 2 6 11 7
4 11 10 2 7 3 11 9 6 5 4 1 0
4 12 10 1 9 6 ...

output:

5

result:

ok single line: '5'

Test #26:

score: 0
Accepted
time: 997ms
memory: 304900kb

input:

14 41 9
2 1
3 10
12 6
8 10
11 5
8 13
9 0
7 4
7 5
4 12
0 11
0 10
12 0
7 11
5 1
11 9
3 1
1 4
11 6
4 0
9 7
2 0
8 9
8 2
9 10
0 6
1 10
13 7
0 13
5 10
1 8
0 1
10 11
11 1
6 10
7 1
9 5
0 3
10 7
2 7
3 2
11 10 13 6 2 7 0 5 11 3 10 4
10 1 10
12 3 10 6 1
12 11 8 4 2 7 3 10 11 0 12 5 1
3 7 6 11 1 10 4 3 12
10 9 ...

output:

8

result:

ok single line: '8'

Test #27:

score: 0
Accepted
time: 825ms
memory: 300764kb

input:

7 17 50
3 0
0 6
1 4
1 2
5 4
3 1
1 6
6 3
5 1
1 0
4 0
6 4
2 4
2 3
6 2
2 5
2 0
3 3 2 5 6
0 1 4
4 2 6 1
0 4 3 4 0 2
1 3 4 5 6
2 2 5 2
2 2 2 5
6 1 5
3 7 5 1 4 3 6 2 0
4 1 1
3 7 6 0 4 3 5 2 1
2 4 4 6 0 5
2 4 0 4 5 1
3 4 0 6 1 3
5 4 4 5 2 1
4 2 0 1
6 1 5
4 4 6 3 2 4
0 4 4 5 0 6
2 7 0 6 1 4 2 5 3
3 7 3 4 0 ...

output:

2

result:

ok single line: '2'

Test #28:

score: 0
Accepted
time: 773ms
memory: 303024kb

input:

5 9 49
1 4
2 3
4 0
3 0
1 3
2 0
2 1
4 2
0 1
3 2 2 3
1 4 1 4 3 2
3 5 2 1 0 3 4
1 4 0 3 4 2
0 5 2 0 4 1 3
4 3 2 0 1
3 3 3 0 4
3 5 2 0 4 1 3
4 3 3 4 1
2 4 2 1 0 4
3 2 2 1
4 1 1
2 5 3 1 4 0 2
0 2 4 1
2 3 3 0 4
0 2 4 2
0 5 4 1 0 3 2
3 5 4 1 3 2 0
4 4 0 4 2 1
2 5 4 3 0 1 2
0 5 1 2 4 3 0
2 1 0
4 3 1 2 4
1 5...

output:

2

result:

ok single line: '2'

Test #29:

score: 0
Accepted
time: 788ms
memory: 303360kb

input:

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

output:

3

result:

ok single line: '3'

Test #30:

score: 0
Accepted
time: 816ms
memory: 295904kb

input:

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

output:

4

result:

ok single line: '4'

Test #31:

score: -100
Wrong Answer
time: 819ms
memory: 293424kb

input:

3 1 3
0 1
0 1 0
1 1 1
2 1 2

output:

2

result:

wrong answer 1st lines differ - expected: '100000000', found: '2'