結果

問題 No.959 tree and fire
ユーザー _matumo_
提出日時 2020-01-11 15:51:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-25 00:55:49
合計ジャッジ時間 3,407 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

def fx(M,N,P):
    if M<N: M,N=N,M
    if M==1:    return P
    if N==1:    return 2*P**2+(M-2)*P**3
    return      4*P**3+2*(N-2+M-2)*P**4+(N-2)*(M-2)*P**5

def main():
    M,N=map(int,input().split())
    P=float(input())
    print(fx(M,N,P))

main()
0