結果

問題 No.959 tree and fire
ユーザー lllllll88938494lllllll88938494
提出日時 2023-03-30 00:10:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 318 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 81,152 KB
最終ジャッジ日時 2024-09-21 14:41:58
合計ジャッジ時間 4,051 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 1 TLE * 1 -- * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w=map(int,input().split())
p=float(input())
ans = 0
l=[1,0,-1,0]
r=[0,1,0,-1]
for i in range(h):
    for j in range(w):
        t = p
        for k in range(4):
            x = i + l[k]
            y = j + r[k]
            if 0<= x < h and 0<= y <w:
                t*=p
        ans += t

print(ans)
                
0