結果
| 問題 |
No.959 tree and fire
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-01-22 12:18:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 237 bytes |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 82,404 KB |
| 実行使用メモリ | 53,552 KB |
| 最終ジャッジ日時 | 2024-06-24 17:10:50 |
| 合計ジャッジ時間 | 3,911 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 53 WA * 1 |
ソースコード
N, M = map(int, input().split())
P = float(input())
if N >= M:
N, M = M, N
ans = 0
if N == 1:
ans = 2 * P ** 2 + max(0, M - 2) * P ** 3
else:
ans = 4 * P ** 3 + 2 * (N + M - 4) * P ** 4 + (M - 2) * (N - 2) * P ** 5
print(ans)
rlangevin