結果

問題 No.959 tree and fire
ユーザー mkawa2
提出日時 2019-12-24 00:28:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 675 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-19 05:20:24
合計ジャッジ時間 3,160 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 53 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n,m=MI()
    p = float(input())
    if n<m:n,m=m,n
    if m>1:
        cp=p**3
        ep=p**4
        ip=p**5
        ans=cp*4+ep*2*(n+m-4)+ip*(n-2)*(m-2)
    else:
        cp=p**2
        ep=p**3
        ans=cp*2+ep*(n-2)
    print(ans)

main()
0