結果

問題 No.959 tree and fire
ユーザー 👑 tamatotamato
提出日時 2019-12-22 13:20:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 71,960 KB
最終ジャッジ日時 2023-10-12 05:26:05
合計ジャッジ時間 6,311 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,376 KB
testcase_01 AC 70 ms
71,816 KB
testcase_02 AC 72 ms
71,864 KB
testcase_03 AC 70 ms
71,876 KB
testcase_04 AC 70 ms
71,528 KB
testcase_05 AC 69 ms
71,648 KB
testcase_06 AC 68 ms
71,756 KB
testcase_07 AC 70 ms
71,740 KB
testcase_08 AC 69 ms
71,568 KB
testcase_09 AC 69 ms
71,408 KB
testcase_10 AC 69 ms
71,884 KB
testcase_11 AC 69 ms
71,748 KB
testcase_12 AC 69 ms
71,696 KB
testcase_13 AC 69 ms
71,404 KB
testcase_14 AC 69 ms
71,716 KB
testcase_15 AC 68 ms
71,752 KB
testcase_16 AC 68 ms
71,668 KB
testcase_17 AC 68 ms
71,864 KB
testcase_18 AC 68 ms
71,792 KB
testcase_19 AC 68 ms
71,820 KB
testcase_20 AC 70 ms
71,500 KB
testcase_21 AC 70 ms
71,540 KB
testcase_22 AC 68 ms
71,956 KB
testcase_23 AC 69 ms
71,652 KB
testcase_24 AC 69 ms
71,612 KB
testcase_25 AC 69 ms
71,532 KB
testcase_26 AC 70 ms
71,820 KB
testcase_27 AC 69 ms
71,848 KB
testcase_28 AC 70 ms
71,608 KB
testcase_29 AC 69 ms
71,664 KB
testcase_30 AC 68 ms
71,820 KB
testcase_31 AC 70 ms
71,396 KB
testcase_32 AC 70 ms
71,520 KB
testcase_33 AC 69 ms
71,408 KB
testcase_34 AC 70 ms
71,792 KB
testcase_35 AC 70 ms
71,628 KB
testcase_36 AC 70 ms
71,960 KB
testcase_37 AC 70 ms
71,404 KB
testcase_38 AC 71 ms
71,832 KB
testcase_39 AC 71 ms
71,756 KB
testcase_40 AC 70 ms
71,408 KB
testcase_41 AC 70 ms
71,636 KB
testcase_42 AC 69 ms
71,480 KB
testcase_43 AC 70 ms
71,804 KB
testcase_44 AC 70 ms
71,424 KB
testcase_45 AC 70 ms
71,520 KB
testcase_46 AC 70 ms
71,452 KB
testcase_47 AC 70 ms
71,428 KB
testcase_48 AC 70 ms
71,420 KB
testcase_49 AC 70 ms
71,480 KB
testcase_50 AC 70 ms
71,372 KB
testcase_51 AC 69 ms
71,052 KB
testcase_52 AC 69 ms
71,512 KB
testcase_53 AC 69 ms
71,192 KB
testcase_54 AC 70 ms
71,608 KB
testcase_55 AC 68 ms
71,532 KB
testcase_56 AC 74 ms
71,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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-2) + p**2 * 2)
else:
    print(p**5 * (N-2) * (M-2) + p**4 * ((N-2)*2 + (M-2)*2) + p**3 * 4)
0