結果

問題 No.959 tree and fire
ユーザー rlangevinrlangevin
提出日時 2023-01-22 12:19:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 72,080 KB
最終ジャッジ日時 2023-09-06 23:08:38
合計ジャッジ時間 6,631 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,540 KB
testcase_01 AC 70 ms
71,780 KB
testcase_02 AC 69 ms
71,784 KB
testcase_03 AC 68 ms
71,800 KB
testcase_04 AC 69 ms
71,972 KB
testcase_05 AC 67 ms
71,604 KB
testcase_06 AC 68 ms
71,724 KB
testcase_07 AC 68 ms
71,824 KB
testcase_08 AC 67 ms
72,036 KB
testcase_09 AC 68 ms
71,596 KB
testcase_10 AC 69 ms
71,988 KB
testcase_11 AC 69 ms
71,812 KB
testcase_12 AC 68 ms
71,540 KB
testcase_13 AC 67 ms
71,812 KB
testcase_14 AC 69 ms
71,896 KB
testcase_15 AC 69 ms
71,888 KB
testcase_16 AC 67 ms
72,040 KB
testcase_17 AC 68 ms
72,080 KB
testcase_18 AC 69 ms
71,856 KB
testcase_19 AC 68 ms
71,840 KB
testcase_20 AC 69 ms
71,900 KB
testcase_21 AC 70 ms
71,816 KB
testcase_22 AC 69 ms
71,756 KB
testcase_23 AC 69 ms
71,756 KB
testcase_24 AC 68 ms
71,816 KB
testcase_25 AC 70 ms
71,752 KB
testcase_26 AC 69 ms
71,992 KB
testcase_27 AC 70 ms
72,016 KB
testcase_28 AC 69 ms
71,724 KB
testcase_29 AC 70 ms
71,980 KB
testcase_30 AC 70 ms
71,860 KB
testcase_31 AC 70 ms
71,604 KB
testcase_32 AC 71 ms
71,968 KB
testcase_33 AC 69 ms
71,732 KB
testcase_34 AC 71 ms
71,896 KB
testcase_35 AC 70 ms
71,884 KB
testcase_36 AC 69 ms
71,652 KB
testcase_37 AC 70 ms
71,640 KB
testcase_38 AC 69 ms
71,900 KB
testcase_39 AC 69 ms
71,800 KB
testcase_40 AC 68 ms
71,860 KB
testcase_41 AC 69 ms
71,984 KB
testcase_42 AC 66 ms
71,740 KB
testcase_43 AC 69 ms
71,660 KB
testcase_44 AC 69 ms
71,620 KB
testcase_45 AC 69 ms
71,692 KB
testcase_46 AC 68 ms
71,624 KB
testcase_47 AC 67 ms
71,320 KB
testcase_48 AC 69 ms
71,688 KB
testcase_49 AC 69 ms
71,160 KB
testcase_50 AC 69 ms
71,392 KB
testcase_51 AC 70 ms
71,276 KB
testcase_52 AC 68 ms
71,168 KB
testcase_53 AC 70 ms
71,164 KB
testcase_54 AC 70 ms
71,784 KB
testcase_55 AC 69 ms
71,892 KB
testcase_56 AC 72 ms
71,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
P = float(input())
if N >= M:
    N, M = M, N
ans = 0
if N == 1:
    if M == 1:
        ans = P
    else:
        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)
0