結果

問題 No.959 tree and fire
コンテスト
ユーザー roaris
提出日時 2019-12-22 02:15:16
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 65 ms / 2,000 ms
+ 298µs
コード長 220 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 230 ms
コンパイル使用メモリ 95,852 KB
実行使用メモリ 79,360 KB
最終ジャッジ日時 2026-08-26 02:18:53
合計ジャッジ時間 6,350 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, M = map(int, input().split())
P = float(input())

if N==1 and M==1:
    print(P)
elif N==1:
    print(2*P**2+(M-2)*P**3)
elif M==1:
    print(2*P**2+(N-2)*P**3)
else:
    print(4*P**3+2*(N+M-4)*P**4+(N-2)*(M-2)*P**5)
0