結果

問題 No.959 tree and fire
ユーザー convexineqconvexineq
提出日時 2021-05-06 04:57:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 82,128 KB
実行使用メモリ 53,984 KB
最終ジャッジ日時 2024-09-13 21:03:52
合計ジャッジ時間 4,006 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
p = float(input())
ans = 0.0
r = [p**i for i in range(9)]
if n==m==1:
    print(r[1])
elif n==1 or m==1:
    print(r[2]*2+r[3]*(n*m-2))
else:
    print(r[3]*4+r[4]*(n+m-4)*2+r[5]*(n-2)*(m-2))
0