結果
| 問題 |
No.959 tree and fire
|
| コンテスト | |
| ユーザー |
tamato
|
| 提出日時 | 2019-12-22 12:11:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 256 bytes |
| コンパイル時間 | 325 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 52,480 KB |
| 最終ジャッジ日時 | 2024-09-14 02:38:48 |
| 合計ジャッジ時間 | 4,192 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 WA * 4 |
ソースコード
N, M = map(int, input().split())
p = float(input())
if N == M == 1:
print(p)
elif N == 1:
print(p**3 * (M-2) + p**2 * 2)
elif M == 1:
print(p**3 + (N-1) + p**2 * 2)
else:
print(p**5 * (N-2) * (M-2) + p**4 * ((N-2)*2 + (M-2)*2) + p**3 * 4)
tamato