結果
| 問題 | No.959 tree and fire |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-22 00:03:59 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 232 bytes |
| 記録 | |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-13 04:20:12 |
| 合計ジャッジ時間 | 3,426 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 46 WA * 8 |
ソースコード
N, M = map(int, input().split())
P = float(input())
ans = max(0,N-2)*max(0,M-2)*P**5
ans += (2*max(0,N-2)+2*max(0,M-2))*P**4
if N==1 and M==1:
ans += P**3
elif N==1 or M==1:
ans += 2*P**3
else:
ans += 4*P**3
print(ans)