結果

問題 No.959 tree and fire
ユーザー yuppe19 😺yuppe19 😺
提出日時 2019-12-22 13:24:41
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 6,640 KB
実行使用メモリ 6,356 KB
最終ジャッジ日時 2023-10-12 05:30:29
合計ジャッジ時間 3,015 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,208 KB
testcase_01 AC 12 ms
6,244 KB
testcase_02 AC 11 ms
6,224 KB
testcase_03 AC 12 ms
6,224 KB
testcase_04 AC 11 ms
6,228 KB
testcase_05 AC 11 ms
6,324 KB
testcase_06 AC 11 ms
6,200 KB
testcase_07 AC 11 ms
6,344 KB
testcase_08 AC 11 ms
6,340 KB
testcase_09 AC 12 ms
6,292 KB
testcase_10 AC 12 ms
6,204 KB
testcase_11 AC 11 ms
6,308 KB
testcase_12 AC 11 ms
6,336 KB
testcase_13 AC 11 ms
6,204 KB
testcase_14 AC 11 ms
6,308 KB
testcase_15 AC 11 ms
6,204 KB
testcase_16 AC 11 ms
6,356 KB
testcase_17 AC 11 ms
6,244 KB
testcase_18 AC 11 ms
6,208 KB
testcase_19 AC 11 ms
6,304 KB
testcase_20 AC 11 ms
6,204 KB
testcase_21 AC 11 ms
6,224 KB
testcase_22 AC 11 ms
6,272 KB
testcase_23 AC 11 ms
6,352 KB
testcase_24 AC 11 ms
6,328 KB
testcase_25 AC 12 ms
6,248 KB
testcase_26 AC 11 ms
6,356 KB
testcase_27 AC 11 ms
6,248 KB
testcase_28 AC 11 ms
6,264 KB
testcase_29 AC 11 ms
6,268 KB
testcase_30 AC 12 ms
6,204 KB
testcase_31 AC 11 ms
6,332 KB
testcase_32 AC 12 ms
6,356 KB
testcase_33 AC 11 ms
6,264 KB
testcase_34 AC 11 ms
6,332 KB
testcase_35 WA -
testcase_36 AC 11 ms
6,248 KB
testcase_37 AC 11 ms
6,264 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 11 ms
6,280 KB
testcase_41 AC 11 ms
6,224 KB
testcase_42 AC 11 ms
6,272 KB
testcase_43 WA -
testcase_44 AC 12 ms
5,988 KB
testcase_45 AC 11 ms
6,032 KB
testcase_46 AC 11 ms
5,904 KB
testcase_47 AC 11 ms
5,952 KB
testcase_48 AC 11 ms
5,956 KB
testcase_49 AC 11 ms
5,896 KB
testcase_50 AC 12 ms
6,008 KB
testcase_51 AC 11 ms
5,840 KB
testcase_52 AC 11 ms
5,952 KB
testcase_53 AC 11 ms
5,860 KB
testcase_54 AC 11 ms
6,276 KB
testcase_55 AC 11 ms
6,324 KB
testcase_56 AC 11 ms
6,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python2
# -*- coding: utf-8 -*-
# †
def f(N, M, p):
    if N > M:
        N, M = M, N
    s = [0] * 5
    if N == 1:
        if M > 1:
            s[1] = 2
            s[2] = M-2
    else:
        s[2] = 4
        s[3] = 2 * (N-2 + M-2)
        s[4] = (N-2) * (M-2)
    res = N * M
    for i in [1, 2, 3, 4]:
        res -= s[i] * (1-p**i)
    res *= p
    return res


N, M = map(int, raw_input().split())
p = float(raw_input())
res = f(N, M, p)
print '{:.10f}'.format(res)
0