QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#308242#1453. Froggerezteam1#AC ✓131ms100356kbC++142.0kb2024-01-19 19:34:382024-01-19 19:34:39

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 30056kb

input:

3 5
>^..v
...<.
.v..^

output:

5

result:

ok answer is '5'

Test #2:

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

input:

3 5
<....
.v...
...>.

output:

31

result:

ok answer is '31'

Test #3:

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

input:

2 2
><
><

output:

-1

result:

ok answer is '-1'

Test #4:

score: 0
Accepted
time: 8ms
memory: 45408kb

input:

49 50
<.................................................
.v................................................
..................................................
..................................................
..................................................
..........................................

output:

4946

result:

ok answer is '4946'

Test #5:

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

input:

50 49
<................................................
.v...............................................
.................................................
.................................................
.................................................
...............................................

output:

4945

result:

ok answer is '4945'

Test #6:

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

input:

50 50
<.................................................
.v................................................
..................................................
..................................................
..................................................
..........................................

output:

146

result:

ok answer is '146'

Test #7:

score: 0
Accepted
time: 7ms
memory: 44288kb

input:

47 48
<...............................................
.v..............................................
................................................
................................................
................................................
................................................
...

output:

4556

result:

ok answer is '4556'

Test #8:

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

input:

2 2
^.
..

output:

-1

result:

ok answer is '-1'

Test #9:

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

input:

2 2
^v
^.

output:

-1

result:

ok answer is '-1'

Test #10:

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

input:

2 2
^v
<v

output:

-1

result:

ok answer is '-1'

Test #11:

score: 0
Accepted
time: 3ms
memory: 30060kb

input:

2 3
v..
...

output:

-1

result:

ok answer is '-1'

Test #12:

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

input:

2 3
^<>
.^.

output:

-1

result:

ok answer is '-1'

Test #13:

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

input:

2 3
vvv
<^<

output:

4

result:

ok answer is '4'

Test #14:

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

input:

4 3
v..
...
...
...

output:

-1

result:

ok answer is '-1'

Test #15:

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

input:

4 3
v..
<..
>>.
.v>

output:

9

result:

ok answer is '9'

Test #16:

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

input:

4 3
vv>
v><
<^>
<>>

output:

4

result:

ok answer is '4'

Test #17:

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

input:

25 50
>....................................v............
...............................<..................
........v.........................................
...........................^......................
..................................................
..........................................

output:

-1

result:

ok answer is '-1'

Test #18:

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

input:

50 25
v........................
.........................
...............>.........
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
...........

output:

-1

result:

ok answer is '-1'

Test #19:

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

input:

27 50
>..........................^......................
.........................<........................
..................................................
..................................................
...................................>..............
..........................................

output:

803

result:

ok answer is '803'

Test #20:

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

input:

50 27
v..........................
...........................
...........................
...........................
.............v.............
......................>....
...........................
...........................
..........^................
...........................
.................

output:

-1

result:

ok answer is '-1'

Test #21:

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

input:

50 50
^.................................................
....................................v.............
..................................................
.................................................>
..................................................
..........................................

output:

-1

result:

ok answer is '-1'

Test #22:

score: 0
Accepted
time: 3ms
memory: 53756kb

input:

49 50
>.................................................
..................................^...............
..................................................
..........<.......................................
..........................^.......................
..........................................

output:

-1

result:

ok answer is '-1'

Test #23:

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

input:

25 50
^........<..<.....<..>.......>.........v..........
.......^................<<........................
....^..<v.>...................v....v..............
.....<.......>.......<......v.....................
.......v............................v.>...........
.........v.................>^.....v.......

output:

86

result:

ok answer is '86'

Test #24:

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

input:

50 25
^.................v......
................>..v.....
.v....v........<.........
...^.....>..><.....>...^v
...............>v.<......
...v...................>.
.........................
.............v...........
..^....<..^..............
.<...v...................
.....v.........^.^..v....
.....^.....

output:

77

result:

ok answer is '77'

Test #25:

score: 0
Accepted
time: 11ms
memory: 39280kb

input:

27 50
v.......^.>..>.<...>.....v..........<........v....
..............>v.................v................
.v..<v............................^...............
.................<.......^......>..........<......
...^...v............................>........v>...
............>.v.....>.....................

output:

50

result:

ok answer is '50'

Test #26:

score: 0
Accepted
time: 3ms
memory: 39280kb

input:

50 27
<.v.....<....>^....<>......
>..^<........>...^.....^v..
........^....<<............
.<...>......^..............
......^....................
.........v.>>..............
......v.............v....>.
..........................>
......>...............v....
.......................^...
....v...<........

output:

94

result:

ok answer is '94'

Test #27:

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

input:

50 50
^..........>^............<............<.......^...
.....<.......>.v........................<........>
.................>................................
........................................>.........
.....>....>.......<...........v.....v<...v....^...
>....................<..............^.....

output:

-1

result:

ok answer is '-1'

Test #28:

score: 0
Accepted
time: 16ms
memory: 57592kb

input:

49 50
<.........^..................>...........^........
.....................v........................>...
.......<.>.>............>v........................
.v.v...<...........................>.<......^.....
.........<.......>...................>............
.......................v...........v......

output:

210

result:

ok answer is '210'

Test #29:

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

input:

25 50
>v.<v.^vv.>..v..v<v>.><v......v.^..>>.v<..v>>><.^<
^.^^..^^>..^.>^..^^...v^^>..v^v.>.<>.<><><.<>.>.^.
<...>>v.<v.>^.>>v^.v...><.<>^^<v>^.>v..>>.>v>v....
vv><>.^<.>v..>.v>..>.^<.v<.>.<v<vv><^.vv..^.^.<^..
<.>v.>.^<.v^v.<.v^^<v..v.>v.vv^>^<><^>>..>..>^><^.
.v>^^<.v.^^>.^>vvv...<.>...<>>><.<<.>>....

output:

20

result:

ok answer is '20'

Test #30:

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

input:

50 25
<^^^.v<^>...^v<^<v..^v<<^
.^<<<..>><.<v.^...>.<vvv<
>.<^.v.^.^<v.^.^><^.^><^.
^.>.^^<vv.^<<.<><<^....^v
.....>.<^<.<>v.v.v...<^<.
>.v>.v<<^..^<>v>>.<..^^>.
vv><^^..^^^.<^>.<.<<v.v>>
.><>.v^v>.^.>.^.^>^<.v>><
.>.>^vv.>^v..>....v><>><.
.>....v>.<.v>^.<.<^^>.v..
.^v..v>..<v.^><v<v.>.<..>
v><.^......

output:

12

result:

ok answer is '12'

Test #31:

score: 0
Accepted
time: 21ms
memory: 47536kb

input:

27 50
^>^..<.^.^<.<^v<v.><v^<.v.^.v.^.v>v^>>.v.vv..^<.<v
.<>>....><v^^.^.v..^.^>..v>.v.>.vv<.^..^^v<.....v.
vv^<.<<<^.<v.<<.v.v...^^^<.>.v..v.^.v<^<>.^vvv^><<
^..><><..<>>v.^><v>..<v..<.<v^<>..vv>..>vv.>^v.^<.
vvv.^...vvv..<.v<<..<.^...><<.<v...<vv...v..>...v.
.><<.^vv><v...><....>.>v>.^>.>.^v<.>.^^...

output:

2

result:

ok answer is '2'

Test #32:

score: 0
Accepted
time: 17ms
memory: 45444kb

input:

50 27
><^<>>...v^.<>.<><<^.>^.<..
v..v^^>.^.>..^^.^.>^v^^><.<
^<>>.v^.^v.>.^.....^..^.>^v
^.<v.^^.>>..v..<>^.vvv>.<..
...<>v..<v.v.vv>.v^^<.v<<.^
..v.>.^>.>^>...^v...<..<<^.
>.v^...^...<v^^<.^>...<^<.<
.^.v>.^<^.v..>v^<^v^.>.^^.^
^<..<v^.<.vv.v<.<^>^...^.<^
>vv..><^.v^><.<...>.<..^v.>
.v<.vv<^v..>.^...

output:

22

result:

ok answer is '22'

Test #33:

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

input:

50 50
^>..^..>^^....<>^.<..><v.v....v>..<..^.v.<.vv^v...
^>^>v<<^^<.....v.v.^><^><.v^..>>.^>.^...^.v^.<<...
>.^<<.>v...>^>>>.v>.><<.>v..v.><<<.>v^.^..>..^.>.^
..><.>v>...>v.>vv.<<^^..>.<<<>^^v.^.>v^v<^....v^>^
<<>v<^>^.<>v..>....<....>.<^.<>>vv...^.<^^<>>>^v^>
<<v....^<>>..v..v^..^^<.^v>..v^..>.<^<^...

output:

16

result:

ok answer is '16'

Test #34:

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

input:

49 50
vv<..v.>v>...<.......^>v..v.>>.><.v>v<>vv<>v.^v.^v
^^><^>^.v<>v<<>....v.^.v..^.v.><^.v^<v.<..>.v.<..<
.>...>v<.v<<>^<.>^<.v^>.>>.>^<<v^..^v.<>.<v^..v.<>
..v^<..^vvv<^v^..v^><v.vv.<v^<<..v..<v<..v<.v.<><<
>^.^>>.v.v....^..^>..>..<..v..^v^..^><v^^<<.<^.<..
.>v.v^^.^.^^v<^..v^^<>^<..^>^..>vv.^<^....

output:

16

result:

ok answer is '16'

Test #35:

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

input:

50 50
^<^><>^^>>vv^>>><^v<v<><>^<v<>v>v^^<>^^v^v>v^^^^>v
<^v><^^<v^^^<>>^<><^^^^^v<<v<vvvv^^^<><v>>v>v>^^^>
<>^^<><^>v<^><<>^^>v<v<<>v^<^>>^vv<v>>><v>v<<v^>><
v<v<>vv>^<v^<<>>^><vv<v^<v<^^>>v<v><v><^^v<v<<^v^<
>><v>^>^>>^>><v<<v<v^<v>^^<^v>^^^><^^^^>v<>>^<^>v>
>v<><v<^<^><<><<<^<^<^><<>v>v^<>v<<<<v>...

output:

2

result:

ok answer is '2'

Test #36:

score: 0
Accepted
time: 131ms
memory: 100356kb

input:

49 50
>>><><v<^><^<^^<v<^<^<>^v>^^^v>><^^v^^v<>^><><^><v
^<<^>v><<><vv<vv^vvvv><^<<^<^>vv<>^vv^>^<^v<<>>>><
v^>^<v^^^vv^^^v>>^^^>vv<v>>>^vv>^>^<v<^^^v>v>^^>>^
>v<<>^><<v^vv<v^v>>>^vvv>>vv^vv^<^^v><>>>>^<v^<^<>
<^^v^<>^^^v<<^^v<vv^v^^<<<>>>^^v^>vvv>v<^^^v^^^^v>
v<<>><<^>^^<^v>>><>vv^v^vv<^>^><<^<<>>>...

output:

10

result:

ok answer is '10'