結果
| 問題 |
No.959 tree and fire
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-29 10:32:33 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 289 bytes |
| コンパイル時間 | 197 ms |
| コンパイル使用メモリ | 12,160 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2025-01-29 10:32:37 |
| 合計ジャッジ時間 | 3,973 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
n, m = map(int, input().split())
p = float(input())
ans = 0
if n == 1 and m == 1:
print(p)
exit()
if (n == 1 and m != 1) or (n != 1 and m == 1):
e = max(n, m)
print(2 * p**2 + (e - 2) * p**3)
exit()
print(4 * p**3 + 2 * (m + n - 4) * p**4 + (m - 2) * (n - 2) * p**5)