結果
問題 |
No.959 tree and fire
|
ユーザー |
![]() |
提出日時 | 2023-03-30 00:43:21 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 315 bytes |
コンパイル時間 | 247 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 52,480 KB |
最終ジャッジ日時 | 2024-09-21 14:56:59 |
合計ジャッジ時間 | 3,919 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 48 WA * 6 |
ソースコード
h,w=map(int,input().split()) p=float(input()) ans = 0 t1 = max(h-2,0) * max(w-2,0) * (p**5) t2 = 0 if w >= 2: t2 += max(h-2,0) * 2 * (p**4) if h >= 2: t2 += max(w-2,0) * 2 * (p**4) if h >= 2 and w >= 2: t3 = 4 * (p**3) elif h < 2 and w < 2: t3 = p else: t3 = 2 * (p**2) print(t1 + t2 + t3)