結果

問題 No.2708 Jewel holder
ユーザー rlangevinrlangevin
提出日時 2024-04-01 21:40:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 781 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 53,460 KB
最終ジャッジ日時 2024-04-01 21:40:55
合計ジャッジ時間 2,062 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 41 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,456 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 40 ms
53,460 KB
testcase_08 AC 36 ms
53,460 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 37 ms
53,460 KB
testcase_11 WA -
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 36 ms
53,460 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 36 ms
53,460 KB
testcase_16 AC 37 ms
53,460 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
M = 10
A = []
for i in range(H):
    A.append(list(input()))

dp = [[[0] * M for _ in range(W)] for _ in range(H)]
dp[0][0][1] = 1
for i in range(H):
    for j in range(W):
        if i == j == 0:
            continue
        if A[i][j] == "#":
            continue
        for m in range(M - 1):
            if i:
                if A[i][j] == "o" and m:
                    dp[i][j][m] += dp[i - 1][j][m - 1]
                if A[i][j] == "x":
                    dp[i][j][m] += dp[i - 1][j][m + 1]
            if j:
                if A[i][j] == "o" and m:
                    dp[i][j][m] += dp[i][j - 1][m - 1]
                if A[i][j] == "x":
                    dp[i][j][m] += dp[i][j - 1][m + 1]
                    
print(sum(dp[-1][-1]))
0