QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#640231#1400. Water BottleNova_NightWind031170 229ms53736kbC++203.5kb2024-10-14 09:46:242024-10-14 09:46:25

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 3ms
memory: 32460kb

input:

59 200 200 2000
#...#.#...##.##.....#......##...#.#.#....#...........###.##.#.....###.#.##...##..#..........#..........##..#.......#...#.#...#.....#......#.#....##...##..#....#......#.#.#....#...#.#.......#.....#..#.
#..##...#..##..#..#.##............#........##.#....#.........#...##.#.................

output:

11
0
12
12
12
11
13
13
13
7
11
13
13
13
13
13
13
13
12
8
10
12
13
13
13
17
13
12
13
12
13
13
13
10
12
13
13
8
12
13
12
13
13
11
13
13
12
13
12
19
11
13
13
13
13
13
13
6
12
13
13
13
12
7
17
12
13
13
12
12
13
13
11
12
13
12
11
13
13
13
13
13
13
11
12
10
13
12
11
13
13
12
13
13
12
12
8
13
8
13
11
13
13...

result:

ok 2000 lines

Test #2:

score: 10
Accepted
time: 0ms
memory: 32456kb

input:

198 77 200 2000
............##......#..........#.....##.....#...#......#......##..........#..
##..#..##..............#..........####.........##.........#....#.#.........#.
#..##.....#....##.#..#.#..##.....#.#....#..#....#...#.#.##.....#.#.#.......#.
....#...#.#......#..#......##.....#..#...............

output:

11
5
13
16
11
11
12
12
14
12
12
12
13
12
12
12
12
11
12
17
13
10
14
11
12
13
13
14
13
13
16
14
12
12
13
12
13
15
12
12
12
14
12
13
14
14
10
12
11
13
13
13
11
13
13
12
11
14
12
11
16
13
13
11
13
13
14
13
12
13
13
12
12
12
12
16
12
13
21
13
13
12
12
13
11
11
11
11
13
11
12
12
12
16
12
14
12
13
13
15
1...

result:

ok 2000 lines

Test #3:

score: 10
Accepted
time: 4ms
memory: 28364kb

input:

200 200 200 2000
###.##.#..#.##..#....###............#...#............#....###...#.#.#....#..##.#..#.#..##.###..#.##...######.##..#..#....###..#....#..#.##...###.#..##..#.....#.#.#.#####....#...#...##..#..#.#.........
###..##.....#.#..#..###..##.#..###..#...#....#.#.....##.#..#...###..#..........#.....

output:

32
32
32
32
25
24
30
39
35
33
24
32
29
28
7
32
-1
32
32
29
28
32
32
20
33
30
32
39
36
43
24
34
32
-1
24
43
32
43
28
39
27
32
17
30
30
27
30
25
30
28
39
32
32
28
28
28
32
30
35
34
30
32
28
23
32
32
39
21
30
39
29
30
30
34
30
32
30
32
30
32
19
24
30
32
23
28
28
32
28
32
-1
30
11
29
32
24
32
30
30
32
3...

result:

ok 2000 lines

Test #4:

score: 10
Accepted
time: 32ms
memory: 32492kb

input:

200 200 200 200000
...#..#..#.##................#.....#..##..#....#.##..#..........#..#.#..#.....###..#........#....#..#...#.#..##.###...##.........#.......##..#..#.....##..........#.#.............##.#.#.....##.#.......
........#.........#...####...#.#.......#..##.##.####..##..####.###...#..##...#.....

output:

34
33
30
19
30
30
33
30
35
32
19
35
30
35
28
30
30
30
30
30
35
-1
28
30
30
35
-1
26
30
35
-1
34
25
35
28
28
28
30
35
33
35
23
30
30
14
27
35
30
28
35
30
35
32
23
30
35
30
28
26
24
30
28
34
28
30
30
35
35
23
33
28
17
18
30
33
24
35
-1
33
30
33
33
28
33
18
33
35
30
30
15
35
28
26
-1
-1
24
33
28
30
23
...

result:

ok 200000 lines

Test #5:

score: 10
Accepted
time: 39ms
memory: 30664kb

input:

200 199 200 200000
...#..##.#.#...#...#.##.....###...##....#...#.......#...##...#....#.#.##.###...#...#...#............#.......#..#...#.#.#....#....#...#......##.....#....#..##.......#..##.#......#...#......#...#..#...
#....##.#.#..#.#...#...#.......#.##...#......#....##.#..###......#.#..##.....#.#....

output:

22
30
30
25
30
30
25
30
-1
22
30
30
21
15
30
30
25
19
-1
30
30
30
25
30
25
30
30
30
30
30
30
30
21
30
30
30
30
20
25
30
21
25
30
30
30
30
30
30
30
30
30
25
20
30
30
30
30
30
30
30
30
30
21
-1
30
23
25
-1
20
30
30
30
30
30
30
8
30
30
19
24
25
-1
30
30
30
30
25
30
25
25
19
21
25
30
23
30
25
28
25
30
-...

result:

ok 200000 lines

Test #6:

score: 10
Accepted
time: 42ms
memory: 32504kb

input:

200 200 200 200000
..##....#...#...#....###.##.#....#.#.....#..#.##...#####.##.#.....#...###.#..........##.#......##....#..##.#..##...#.#...#......##.##.......#.#.##.##....##.#.#..........######.#....................##.
..#...#.#.#...#..##.#..#...#....#.#..........#......##.#..##...#...#..#...#........

output:

25
25
23
22
13
25
25
25
25
23
22
-1
25
25
22
25
27
22
22
17
16
25
27
10
25
22
22
25
25
23
21
22
25
25
25
27
25
23
13
21
25
27
25
22
25
-1
16
25
31
22
23
25
23
27
23
25
-1
27
22
21
23
23
23
21
-1
25
25
25
23
25
23
-1
25
25
25
-1
-1
21
-1
27
-1
25
12
25
-1
22
31
22
18
23
25
25
25
27
-1
25
25
25
25
21
...

result:

ok 200000 lines

Test #7:

score: 10
Accepted
time: 41ms
memory: 30444kb

input:

200 200 200 200000
.#.#...#....#.#..##.#..#.######..#.##......#..#.#....####.#..#.#.#.#....#........#..#..#.....#.##...#..#.#......##.##...#......###..##.##....###..##.#.#.#......#..##...#..#.#..#...#...........#.......
#.....##......#.#..##.#....#..#...#.#.#..#...#......#...##...............#...#.#...

output:

-1
-1
21
21
-1
21
-1
17
21
-1
13
15
-1
-1
16
21
21
16
14
17
16
21
21
17
17
-1
21
21
21
-1
21
21
17
49
24
39
21
21
21
17
13
23
15
21
12
16
21
17
13
21
21
-1
21
21
16
-1
20
15
-1
16
-1
-1
15
21
21
16
14
17
21
24
21
21
15
20
16
16
-1
39
16
16
-1
21
17
21
24
16
16
16
21
21
20
-1
39
-1
21
-1
20
21
17
-1
...

result:

ok 200000 lines

Test #8:

score: 10
Accepted
time: 38ms
memory: 30468kb

input:

200 200 200 200000
........................................................................................................................................................................................................
.###############################################################################...

output:

13
1373
7016
7016
7016
15
7016
7016
13
7016
7016
13
7016
7
10
1373
10
7016
7016
14
7016
7016
7016
11
7016
20
7016
13
7016
13
11
7016
7016
13
7016
10
7016
11
7016
16
12
7016
7016
10
21
7016
7016
13
7016
7016
7016
14
13
11
11
7016
19
14
14
14
7016
13
16
13
13
14
7016
16
7016
11
7016
14
7016
7016
10
70...

result:

ok 200000 lines

Test #9:

score: 10
Accepted
time: 38ms
memory: 30476kb

input:

200 200 200 200000
........................................................................................................................................................................................................
.###############################################################################...

output:

500
440
440
500
500
440
500
324
234
500
500
324
291
500
440
500
500
440
500
67
217
181
500
335
500
500
179
440
46
324
440
324
500
500
500
440
440
335
500
324
440
324
500
213
151
500
440
153
324
291
500
143
500
440
500
440
193
200
440
500
324
324
324
500
440
440
272
324
500
324
192
500
500
39
335
192...

result:

ok 200000 lines

Subtask #2:

score: 30
Accepted

Test #10:

score: 30
Accepted
time: 9ms
memory: 45528kb

input:

2000 100 1000 1
..##...........#..#....#.####...#...#....#.........#.#..#.#.######.##..#..#......#..#..##.#..#.##...
.........##..#.####.###..#......#.#...#.....#......#..#..#...#.##...##..##...#.#..####.##.#........#
.....#.....................##...#..#..#.#........#.#...#.#...###.....#...#.#.........

output:

40

result:

ok single line: '40'

Test #11:

score: 30
Accepted
time: 18ms
memory: 35224kb

input:

200 2000 5000 1
...#..#.##.#.#.#..#...#..#....#.##....##...#.......#.......#.##.#......#....##.##.....#.##.#.#........#..#.#..#...#.##...#..#....##.....#....##..#...##..#......#...#.#....##..##.#...##.....#......##....#.#....#..##.##..#.....##......#..#..#.....##.#..#.#..#.....##.#.#.##...##...#.......

output:

21

result:

ok single line: '21'

Test #12:

score: 30
Accepted
time: 157ms
memory: 49904kb

input:

2000 2000 5000 1
..##..#.###..#.####........##.#..##..####..#.#..#.#....#.##.#..##.##...###....##...##...##..#..####....#.##..###..##.##.##..##..####..#.##..#.#..#..##........##....#.#....##..#...##....##.##...######..#......####..#..#.#.#..##.##....#.##.#..##..##..#.###.#.##.....##.....#...#.#....#...

output:

144

result:

ok single line: '144'

Test #13:

score: 30
Accepted
time: 191ms
memory: 46800kb

input:

1988 2000 5000 1
......#....#..#........###....#..#..#...#...##......#.##..#..#.....#....#....#.##.##...#...#.##.......###..#..#.#..##...#.#..#.##.##.....##.#........#.#..##.#...####.#...##.###.......#.....#...###.#....###..#...#.....#.#.#...#....#..#..#....#..#.#.#.#..#.#..#.......##....#.#..#..#.#...

output:

52

result:

ok single line: '52'

Test #14:

score: 30
Accepted
time: 218ms
memory: 47908kb

input:

2000 2000 5000 1
.........#.#......###..................#......#.......##..#.....#.#.####.#...#.##..........#..##...#.#.#.#.#..#.#..##...#...##....#...#..#......#.#.#................##...#..#...........##.##...........#...#..#..#.##......#.....#.###.......#..............................###......#......

output:

48

result:

ok single line: '48'

Test #15:

score: 30
Accepted
time: 152ms
memory: 48560kb

input:

2000 2000 5000 1
..#....#....#.#.##...#.###.##.#..##.####.......#.#..##...##.#.#.#..##.#.##...#.#.##..#.#..#........#........##....#.....#..#..#...##..###..#......#####.###.##.....#...#..##...#..#..#..#...#.....#.#...######......##...##..###.#####...##.#..#...#..##..#......#..#.#.###......#..##.#.#....

output:

-1

result:

ok single line: '-1'

Test #16:

score: 30
Accepted
time: 204ms
memory: 46720kb

input:

2000 1987 5000 1
#......#....#.#.....#.#...#.........#...##......##....##......#.#...##.##.#....#..#...#...#.......##...#....#.......#.......#....#....##.....##..#.#.....###...##...............##....#....#####.#....##...#.#.#.....##.#.##........####........##.#..##...##....#...#...##..##.###..#........

output:

51

result:

ok single line: '51'

Test #17:

score: 30
Accepted
time: 225ms
memory: 47980kb

input:

2000 2000 5000 1
..............##.........#.#...............#....#...#....##.###.....#.##.#.#..#...#.......#..#............#....#.###..#.......#.##...#........#...#..#.#.#.....###....................#.......##.....#..#......#..........#.#.#.................##....#........#...#..#.##..#..........#.#....

output:

49

result:

ok single line: '49'

Test #18:

score: 30
Accepted
time: 227ms
memory: 50088kb

input:

2000 1995 5000 1
..................................#...#.......................................#..................................#......................................................................#....#...................#.......................#....................................................

output:

44

result:

ok single line: '44'

Test #19:

score: 30
Accepted
time: 171ms
memory: 46108kb

input:

2000 2000 500 1
.........#...#...#..#..#..#..##...##...#.#..#...##.....#..#..#..##.#..###.#..#..#.##.............#.#.#..#...#....#.#.....##.###...##.#.....#..#..##..#.###...###...#........##.#..#.#..###.......##...#..##...#...###...#.#....#.....####....#.....#..#...#...#..#.....#..#......##.#.....#....

output:

166

result:

ok single line: '166'

Test #20:

score: 30
Accepted
time: 178ms
memory: 46180kb

input:

2000 2000 2000 1
.#..#..#....#.#..#.#..#.#####......###......#......#..#.........#.##....#..#.....#.#.......###.......#............##...#..##...#.#...#..#...#......#...#..#......#..............#.##.........#.....#....#.......#.#.......##...#.#...#......#.....#..#.......##..#....##.....#.....#.#........

output:

81

result:

ok single line: '81'

Test #21:

score: 30
Accepted
time: 64ms
memory: 46840kb

input:

2000 2000 5000 1
..............................................................................................................................................................................................................................................................................................

output:

13

result:

ok single line: '13'

Test #22:

score: 30
Accepted
time: 80ms
memory: 48704kb

input:

2000 2000 5000 1
..............................................................................................................................................................................................................................................................................................

output:

2365

result:

ok single line: '2365'

Test #23:

score: 30
Accepted
time: 54ms
memory: 48696kb

input:

2000 2000 5000 1
..............................................................................................................................................................................................................................................................................................

output:

1062003

result:

ok single line: '1062003'

Test #24:

score: 30
Accepted
time: 83ms
memory: 46428kb

input:

2000 2000 5000 1
..............................................................................................................................................................................................................................................................................................

output:

2247

result:

ok single line: '2247'

Subtask #3:

score: 30
Accepted

Dependency #2:

100%
Accepted

Test #25:

score: 30
Accepted
time: 9ms
memory: 47284kb

input:

2000 100 1000 1000
#.....##.....#..##..........#....#..#..##.#..#....#..##..#...#......#....###.#.#..#...##..#....##...
##.#.#...#.####..#.#..#.#........##..........#..#....##..#.......#..........###..#.#..#..........#..
...##...##..##.#....#.#..#......#........####.#....#.##.#.#..#.#..#........#......

output:

31
34
33
31
22
37
33
31
33
33
30
-1
34
34
30
33
33
31
31
33
37
33
31
28
33
33
31
31
31
33
31
33
33
30
35
33
33
30
33
31
26
33
33
30
32
31
33
24
-1
31
30
33
33
-1
-1
32
33
31
31
33
30
33
-1
22
33
37
33
33
31
33
-1
33
28
37
24
33
33
33
30
32
33
31
34
18
33
33
31
25
33
24
33
30
33
26
30
30
30
31
33
35
...

result:

ok 1000 lines

Test #26:

score: 30
Accepted
time: 19ms
memory: 30456kb

input:

200 2000 1000 1000
...#..#...##.....##..#.####....###.#......#..#...#...........##.#....#.#...#.#...#...##...#.##...####..............#.##...##.......#.......#.#....###...#.#..#............#.....#.....#.#.##.#..#.#..#......#....###...................#.....#.##..#......#...#..#.##.#...#.........#.#.....

output:

47
29
41
48
35
35
47
39
39
47
-1
35
47
47
40
33
35
47
32
41
47
47
47
47
30
32
44
47
47
47
-1
41
41
47
40
47
47
41
-1
47
41
47
44
-1
41
-1
47
47
47
47
47
35
47
43
35
39
47
42
41
41
44
47
42
41
47
40
47
44
41
35
47
41
47
41
44
47
47
35
47
47
35
40
-1
41
41
42
39
50
47
47
43
47
47
47
47
41
41
47
47
47
...

result:

ok 1000 lines

Test #27:

score: 30
Accepted
time: 140ms
memory: 45852kb

input:

2000 2000 500 10000
##...####.#.#.##........###..##..##.......#......###.....#....#....##........#####.....#..##.##.......#.##......#....###...#.#.###.#...##.....##..###...#..#....#..##.#.#..###...#.....#.#........##...#.#.##.......#..##.........#...##..#.####...#...#...#.#.###.#.###....#..#..#..#.....

output:

-1
-1
323
392
-1
-1
-1
391
392
-1
392
613
355
392
-1
-1
-1
408
392
613
-1
-1
-1
-1
-1
392
408
-1
-1
271
296
350
295
-1
392
-1
-1
-1
-1
-1
-1
323
-1
350
-1
480
350
-1
-1
392
-1
-1
-1
408
296
-1
-1
-1
-1
-1
613
-1
-1
-1
-1
613
-1
392
-1
392
295
-1
296
-1
296
-1
-1
613
613
613
408
613
-1
408
350
-1
295...

result:

ok 10000 lines

Test #28:

score: 30
Accepted
time: 204ms
memory: 46808kb

input:

1988 2000 5000 10000
..#.#.##.........###...#...#......###..........#..#.#........##.###....#..#.#.......##....##.#####.......#..........#..##..#.....##..##.........##..#.....#..##................#.###...#....###.#.#.##.......####................#.....#..##....###......###.#..........##.#..##.##..#....

output:

51
54
53
54
53
54
65
50
54
52
50
53
57
51
53
53
54
51
49
54
53
59
54
51
54
51
54
54
48
53
56
54
58
56
-1
53
55
55
55
51
53
56
-1
53
53
53
47
60
51
51
54
52
54
56
53
53
48
54
51
53
54
45
49
52
53
51
53
54
54
51
49
53
54
-1
54
53
53
53
51
49
-1
50
48
49
48
54
53
58
-1
54
52
-1
51
53
43
51
-1
44
48
52
...

result:

ok 10000 lines

Test #29:

score: 30
Accepted
time: 207ms
memory: 47584kb

input:

2000 2000 5000 10000
...#....#........#.......##..#..#....##.#......#........##..#.##.###....##..#..#.#......#.....#.#.....................#..........#...#..#.......##.....#.#....#............#....##...#......##.#.#....##.......#.....#..#.............#.#......#...#.........#.#........####..........#...

output:

43
43
44
40
41
43
44
44
47
44
45
50
45
44
44
45
44
42
41
37
44
44
43
42
45
48
44
45
43
45
45
48
44
45
44
44
47
36
44
45
44
41
50
44
47
50
43
48
42
44
47
44
47
44
44
39
45
40
47
40
43
48
47
44
45
44
53
45
46
44
41
43
45
44
43
56
43
44
43
44
44
49
43
55
45
45
49
47
45
44
45
44
45
43
67
45
47
44
43
44
...

result:

ok 10000 lines

Test #30:

score: 30
Accepted
time: 229ms
memory: 53736kb

input:

2000 1995 5000 10000
...................................................................................................................................................................................................................................................................#......................

output:

40
40
41
40
44
41
47
40
41
40
40
40
41
40
55
40
41
42
41
48
40
40
48
40
40
45
40
41
40
40
40
41
38
40
41
41
37
44
41
40
48
34
40
39
42
40
36
42
41
41
44
40
41
41
40
39
41
41
39
37
42
41
48
41
40
41
40
41
40
43
39
41
40
40
41
46
46
41
48
41
40
40
38
40
40
40
37
41
40
41
41
34
41
41
40
47
42
38
40
40
...

result:

ok 10000 lines

Test #31:

score: 30
Accepted
time: 165ms
memory: 46400kb

input:

2000 2000 500 10000
#..#...#....#......##...#.....#.#..#.....#......#....#....#####.....#.....#..##...........####..#.##.#.#.#.#..#...#.......#.#...#.#..#.##.#...#.......##.#...##...#..##..###...#.#....#.#..#..##..##......#.....#.#..........#...#....#......#...........#..#..#.#.#......#.##..#.#........

output:

159
161
161
161
161
-1
74
161
161
153
-1
140
161
152
151
161
154
161
168
159
161
161
139
132
161
188
188
152
146
161
159
153
-1
153
134
153
168
161
154
153
161
131
6647
190
161
188
147
153
153
147
161
161
161
-1
140
161
168
168
161
153
-1
168
161
168
163
161
153
161
158
153
168
161
161
132
161
155
6...

result:

ok 10000 lines

Test #32:

score: 30
Accepted
time: 193ms
memory: 47076kb

input:

2000 2000 5000 10000
##........#.#..##.....#.#..####..####.....#...##...##...#..#...##..#...#...##..#.#...#..####....#.....##...#..#...#..#....#.#..##..........#.......#.#.....###...##....###.#.#...#...###.#..##..##....#.......#...#.#..##.....#...#......#..#...#.##...#......#.##..##.....#.##..#.#......

output:

51
44
30
48
52
66
49
49
48
46
29369
48
55
52
53
53
52
50
48
51
66
49
48
54
49
66
55
55
66
49
49
50
49
51
55
53
55
47
43
-1
47
55
55
58
58
48
66
50
-1
50
49
49
53
36
55
49
72
53
55
50
66
53
53
66
51
50
53
49
50
55
49
53
53
49
56
50
55
50
53
55
51
49
66
66
51
49
45
48
-1
54
53
51
48
49
48
34
45
57
52
...

result:

ok 10000 lines

Test #33:

score: 30
Accepted
time: 66ms
memory: 48508kb

input:

2000 2000 5000 10000
..........................................................................................................................................................................................................................................................................................

output:

307123
13
307123
12
11
307123
13
15
15
307123
307123
307123
307123
13
307123
9
307123
13
12
307123
307123
307123
13
13
13
307123
307123
307123
307123
13
307123
11
14
307123
13
13
307123
307123
13
15
307123
13
307123
15
307123
307123
307123
307123
14
307123
307123
307123
307123
13
307123
307123
30712...

result:

ok 10000 lines

Test #34:

score: 30
Accepted
time: 88ms
memory: 46368kb

input:

2000 2000 5000 10000
..........................................................................................................................................................................................................................................................................................

output:

2553
2553
3132
2234
2270
3132
2234
3132
2802
3132
2234
2802
2214
3132
1187
3132
3132
3132
2802
2802
1905
2179
3132
3132
1714
2234
2742
2802
3132
2595
2553
1722
2802
2362
2214
2802
3132
2553
1413
2802
3132
2802
2802
2553
1517
2802
2802
2802
3132
2553
2553
3132
2553
1929
2802
2553
2553
3132
3132
2802
...

result:

ok 10000 lines

Test #35:

score: 30
Accepted
time: 75ms
memory: 45688kb

input:

2000 2000 5000 10000
..........................................................................................................................................................................................................................................................................................

output:

3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
3748
...

result:

ok 10000 lines

Subtask #4:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #36:

score: 0
Wrong Answer
time: 205ms
memory: 50560kb

input:

1997 2000 10000 200000
..##......#...#.......#.#..##..##..##.#............#.#.##.###.##.##.#.##...#.#.##.######.#.##.#...#.##......#....#..#.#.##.#......#.##.##.#..#.#...###.........#..#....##..#..#.###.##.#..##........##..##....#...##.##..##.#.#.#..##..###..#...#..##.#....##.#...###...#.##..#.#.......

output:

-1
76
84
91
96
-1
107
67
-1
72
84
74
107
-1
-1
-1
108
79
83
98
-1
141
-1
-1
84
-1
-1
-1
98
-1
-1
118
-1
76
-1
84
72
-1
-1
-1
98
99
-1
-1
74
73
68
98
-1
118
90
77
-1
-1
-1
107
-1
-1
84
-1
84
98
74
90
96
84
-1
-1
-1
88
75
-1
98
-1
-1
98
-1
72
73
98
85
-1
98
-1
84
-1
98
-1
-1
-1
87
98
93
-1
107
-1
76
-...

result:

wrong answer 60742nd lines differ - expected: '1', found: '0'