結果
問題 |
No.2708 Jewel holder
|
ユーザー |
|
提出日時 | 2024-03-31 14:41:51 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 571 bytes |
コンパイル時間 | 301 ms |
コンパイル使用メモリ | 82,184 KB |
実行使用メモリ | 75,828 KB |
最終ジャッジ日時 | 2024-09-30 19:50:04 |
合計ジャッジ時間 | 1,914 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 17 |
ソースコード
H, W = map(int, input().split()) world = [] for i in range(H): world.append(list(e for e in input())) print(world) chash = dict() def how_much(h, w): global H, W, chash, world if h == H & w == W: return 1 if h > H or w > W: return 0 if world[h - 1][w - 1] == "#": return 0 # print(how_much(h + 1, w) + how_much(h, w + 1)) if (h, w) not in chash.keys(): chash["x:{},y:{}".format(h, w)] = how_much(h + 1, w) + how_much(h, w + 1) return chash["x:{},y:{}".format(h, w)] # print(chash) print(how_much(1, 1))