結果

問題 No.959 tree and fire
ユーザー brthyyjp
提出日時 2021-01-05 03:23:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,092 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-10-15 12:04:51
合計ジャッジ時間 4,351 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
p = float(input())

if n == 1:
    if m == 1:
        ans = p
    else:
        ans = 2*p*p+(m-2)*p*p**2
else:
    if m == 1:
        ans = 2*p*p+(n-2)*p*p**2
    else:
        ans = 4*p*p**2+(2*(m-2)+2*(n-2))*p*p**3+(m-2)*(n-2)*p*p**4
print(ans)
0