QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#294018#4856. Puzzle: Patrick's Paraboxucup-team025#AC ✓233ms84176kbC++2028.9kb2023-12-30 02:21:212023-12-30 02:21:22

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
9 9
#########
#####..-#
#..=##.##
#.p.##.##
....##.##
#...b..##
#...##.##
#....####
####.####
9 9
#########
#.......#
#.#####.#
#.#=....#
..#....-#
###.p.#.#
#.....#b#
#.....#.#
####.####
9 9
####.####
#....####
#.####.##
#.......#
#.......#
###.#####
#=.b#..##
#-..p..##
#########

output:

7
4
19

result:

ok 3 number(s): "7 4 19"

Test #2:

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

input:

1
2 2
pb
-=

output:

-1

result:

ok 1 number(s): "-1"

Test #3:

score: 0
Accepted
time: 233ms
memory: 3540kb

input:

100000
2 2
-p
=b
2 2
b-
=p
2 2
-b
p=
2 2
-p
b=
2 2
p=
-b
2 2
b=
-p
2 2
=b
-p
2 2
b=
-p
2 2
-p
b=
2 2
b=
-p
2 2
p=
b-
2 2
pb
=-
2 2
p-
=b
2 2
-=
pb
2 2
=p
-b
2 2
p=
-b
2 2
-b
=p
2 2
=p
-b
2 2
=b
-p
2 2
=-
bp
2 2
-=
bp
2 2
bp
=-
2 2
=-
bp
2 2
=b
-p
2 2
bp
-=
2 2
-b
p=
2 2
=p
b-
2 2
b-
p=
2 2
pb
=-
2 2...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 42ms
memory: 32448kb

input:

1
500 200
#....#.#.#.##.#..#.#..#......#...#..#...#.#...........#.#.#..#...###..##..#.#.#.....#........#..####..#..#..#####...............#.#......#.##.#..##.........##.###.#....###..#...#.#...#...##..##.#...#.
##..##.....#.##..#.#.###.#....#...#..#.#....##..............##.....#...#....#..##.##...##...

output:

-1

result:

ok 1 number(s): "-1"

Test #5:

score: 0
Accepted
time: 56ms
memory: 32460kb

input:

1
200 500
...##..#.....#.......##..##.#......#...#.....#.##.##..#...##...##....#..##.##..##..#..........####.......#.#...#....##....#.#..#..##....#..#......###...#.#..#.#..#..#.....#.#......#.........###....#..#.............#......#..#.#..####.#...#..#.#..##...#...##.###....#.####..#......#...#..#.....

output:

-1

result:

ok 1 number(s): "-1"

Test #6:

score: 0
Accepted
time: 83ms
memory: 84176kb

input:

1
100000 2
..
.#
..
##
..
..
..
##
.#
#.
#.
##
##
#.
##
##
..
#.
##
#.
..
..
..
##
.#
.#
.#
..
.#
.#
.#
.#
##
##
##
##
..
..
#.
.#
#.
..
.#
##
##
##
##
.#
##
..
.#
..
..
#.
#.
##
#.
##
.#
#.
#.
#.
##
.#
..
.#
.#
.#
##
#.
..
..
##
..
#.
##
.#
..
##
##
.#
.#
#.
##
..
.#
#.
..
..
#.
#.
##
..
.#
#.
#.
#...

output:

-1

result:

ok 1 number(s): "-1"

Test #7:

score: 0
Accepted
time: 68ms
memory: 64368kb

input:

1
2 100000
.......##........###.#.#..###.#....##.##.#.#.##..#..##.#.#...##.#...######...#....##..#####.###.##..#####...#....####..#.#.###...####.###..#..#.###..#########...#.#.####..##.#####..#...##.####..#.###..##..##...##...#.##.#.#..##....###..##.#...#......##...#.####.#....##...#.#....#.#.###.##...

output:

-1

result:

ok 1 number(s): "-1"

Test #8:

score: 0
Accepted
time: 64ms
memory: 28264kb

input:

10
19 64
..#...........#.........#.............#..........#...#....#....#
....#.##......#......#..#........##.......#................#...#
...................#....#....##...#....#...#...#................
#...#....#...#.#....#.#...............#....#.................#..
...........#......###...#.........

output:

-1
-1
-1
87
87
274
10
17
16
118

result:

ok 10 numbers

Test #9:

score: 0
Accepted
time: 38ms
memory: 16392kb

input:

10
89 145
........#........#..#.#.................................#..#.....#......#...#...#.#.......#..........................#.#...#.............#.......
..#...#.............#....#...........................#...#....................#.....##..##.......##.....#.#..#...#....#....#.#.#...................

output:

102
259
127
9
50
107
38
16
-1
-1

result:

ok 10 numbers

Test #10:

score: 0
Accepted
time: 65ms
memory: 28788kb

input:

10
102 56
.#..#.............#...#...............#..........#......
.........#..............#.............#...#.............
......#.......................#........................#
.#.............##..#..#....#............##..............
.#........#................#....#.#...........#.........
........

output:

117
-1
64
2
74
13
252
-1
-1
-1

result:

ok 10 numbers

Test #11:

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

input:

10
134 115
...............................#...............#..............##........#.....#.......#...#...............#........
...........#...#.......#....#.....#...............#.............#..................#......#.........#..........#...
.............#.................#....................#.......

output:

31
75
157
45
9
99
47
60
-1
-1

result:

ok 10 numbers

Test #12:

score: 0
Accepted
time: 43ms
memory: 4116kb

input:

1000
3 3
#p=
.#.
b-.
9 4
p.#.
##.#
.#.#
.#.b
...#
=###
###-
###.
.###
4 10
.p..###.=.
##..#..##.
.b..##.#.#
.##.-.#...
2 12
....#....#p#
...#-#=..b##
21 33
#.########....#.#..#.#.#..###.#..
.##.##.....##.##.....#..#...###..
..#####..###...#..#..#.#..##..###
.#.#..####..#...###..####.###...#
##.#.#.....

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
...

result:

ok 1000 numbers

Test #13:

score: 0
Accepted
time: 54ms
memory: 4360kb

input:

1000
20 15
##.b#.....##.##
##...##...##...
.#.#####..#.##.
.###......##...
.....#.....##..
=.#.#..##.#.#..
.#....#.....#.#
#-.....#.....#.
##..###.#.#..#.
#..##..#..#....
..#.#....#..#..
#..##.....###..
.#..#........##
...##.#...#..#.
#.p#.###..#..#.
...#.##....#.#.
##...#...###...
...#..###..#..#
....

output:

-1
-1
2
-1
-1
-1
-1
-1
-1
1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3
-1
-1
-1
2
-1
6
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
14
-1
3
3
5
-1
-1
-1
28
12
-1
17
-1
-1
-1
-1
...

result:

ok 1000 numbers

Test #14:

score: 0
Accepted
time: 52ms
memory: 4256kb

input:

1000
3 12
..b##p..#..#
.#...=....#-
...#.##.#..#
6 11
....b..#...
.#...#..#.#
#.##p.###.#
.....=....#
..#-#..##..
..#.##...#.
9 36
#..........#..#.............#.##....
..#.......#............##...........
....##.#p.......b...#.......#..#....
..#...#....#...#.......#...##...#.#.
....###.##........#.#...

output:

-1
-1
16
-1
-1
-1
-1
16
8
-1
-1
-1
-1
-1
-1
-1
-1
1
-1
1
4
-1
4
4
-1
-1
-1
-1
-1
-1
5
-1
-1
-1
-1
-1
1
-1
-1
-1
-1
3
-1
-1
-1
-1
-1
-1
9
-1
5
-1
-1
11
-1
-1
-1
-1
3
3
16
-1
-1
-1
-1
-1
7
19
-1
-1
-1
-1
35
-1
1
-1
-1
-1
-1
3
18
-1
-1
-1
9
-1
-1
-1
10
-1
4
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
21
-1
-1
...

result:

ok 1000 numbers

Test #15:

score: 0
Accepted
time: 56ms
memory: 4432kb

input:

1000
8 15
........#b#...=
...#....#..#...
....#.......#..
..p-#.#......#.
....##..#..#...
.#.#...........
#..#..........#
.#.....#...#...
4 26
..............#...#.#.....
.....p..#.........#.#....#
.#.........#.=.#......##..
.##....b..............#.-.
8 2
.b
p.
..
-.
#=
..
#.
..
11 8
..=..-..
...###....

output:

-1
-1
-1
10
-1
4
2
6
-1
3
-1
-1
-1
-1
-1
3
-1
-1
-1
-1
4
-1
-1
-1
-1
-1
-1
5
20
49
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
9
-1
3
2
2
-1
-1
-1
-1
5
12
-1
-1
4
-1
8
-1
3
2
-1
-1
-1
-1
1
-1
-1
-1
12
-1
-1
-1
-1
-1
-1
-1
-1
-1
5
-1
-1
-1
-1
2
-1
-1
-1
-1
11
2
7
-1
14
6
-1
-1
-1
4
-1
-1
-1
2
-1
-1
-1
-1
-1
7
-1
-...

result:

ok 1000 numbers

Test #16:

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

input:

1000
12 4
....
..#.
#p..
##..
....
#=..
.#.#
....
....
..#.
.#b.
#-..
31 5
.....
...#.
.#.##
..#..
.#..#
#...#
..#..
.#...
..#..
.....
.....
.#b..
#.=..
#..#.
.....
.....
.....
.....
.....
.....
#....
....#
...##
.....
##...
#..-.
...#.
..#p.
#....
.....
.....
16 14
..............
.##.###.......
......

output:

-1
15
-1
-1
-1
-1
-1
2
-1
5
4
2
-1
-1
-1
5
3
2
-1
-1
-1
18
10
2
-1
-1
-1
-1
14
-1
-1
-1
-1
-1
10
-1
-1
10
4
-1
-1
-1
-1
-1
3
2
-1
-1
-1
-1
-1
2
1
3
-1
-1
8
-1
-1
19
-1
-1
-1
3
-1
-1
-1
-1
-1
7
-1
-1
1
-1
-1
-1
6
-1
-1
-1
2
1
-1
-1
-1
5
-1
-1
5
-1
2
-1
-1
4
-1
6
4
-1
-1
-1
-1
-1
17
-1
-1
-1
4
-1
-1
-...

result:

ok 1000 numbers