No.2430 Damage Zone
問題文最終更新日: 2023-08-18 21:15:01
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
traP 作問ハッカソンコンテスト 001
(順位表)
の他の問題:
Problem Statement
There is a field with $H$ rows and $W$ columns. The cell at the $i$-th row from the top and the $j$-th column from the left is called $(i,j)$. Each cell of the field is one of an empty cell, a damage floor, or a wall.
- An empty cell is a cell that can be passed through freely.
- A damage floor is a cell that decreases stamina by $1$ when passed through.
- A wall is a cell that cannot be passed through.
Constraints
- $H,W,K$ are integers
- $1 \leq H,W \leq 100$
- $1 \leq K \leq H+W$
- $S_i$ is a string of length $W$ consisting only of
.,o,#, and its $j$-th character represents the state of the cell $(i,j)$ of the field as follows. .means it is an empty cellomeans it is a damage floor#means it is a wall- The top-left corner $(1,1)$ and the bottom-right corner $(H,W)$ are empty cells
Input
$H\ W\ K$ $S_1$ $\vdots$ $S_H$
Output
Output the answer modulo $998244353$ on 1 line.
Sample
Sample 1
Input
5 5 2 ..... .o... ..... ...o. .....
Output
46
Out of all $70$ movement paths, there are $24$ paths on which stamina decreases by $2$, so the answer to output is $46$.
Sample 2
Input
3 3 1 ... ... ...
Output
6
The number of movement paths is $_4C_2$, which is $6$.
Sample 3
Input
40 40 15
...o##..o..........o.o.......o....#.....
..o..........o.........#...#........o...
..##................o....o#.o....#.o....
...#....o.......o.......o...#.....o.....
..o.o........#o...##.#....o..o......o...
...#..o......o.................o........
....o....oo....#..........o.............
#o..........o........o...........o....##
#....oo...#.......o#..........o.........
o....o.o#.......o..o.oo#....o#.o#o......
..............#..o...o............o.....
o.....ooo........o......o....o......o...
......#.o...............#.....o...ooo...
.....#.o..#........o.......#.o.......#..
........#......o#.................#o....
.......##..o.....oo.....#....#........o.
...#.o....o...o...#o..o...o#....#.......
...o.o.......o....##.oo#......o.........
.......o......o..........o..o....#.#...o
.o.......o#.ooo...o.......o......oo##...
.o...................oo#..#o....o.......
oo...o.#......................o......o..
....o................#..................
....o...............o.......#.........#.
..........#..o.....o.........#..#o...#o.
...........#.o........#......o.o........
...o..o..#.........oo.o..o#....#o.......
#.#.....##.#.o#.....#.....o.o......o....
.#..#.#o....................#.....o.....
..o...................#.#.....#.........
.o..o.#o...o..o.o.o..........ooo.......o
....o..o#.........o.o.o.o.#.oo..o.......
o..o..#....o...#.....oo.......o....#...o
.o....#.o...o...o....#..o.#...ooo......o
...o.....##......#.oo.......#.o...o.....
.....o.....o.#o......#.............o..o.
......o...........o..#oo...o..........o.
#.....##..o......................oo...o.
..................o....#o......o...o....
...............o.o...o#...o.o..o....oo..
Output
894449985
Note that you must find the answer modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
noya2
Kak1_n0_tane