結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,292 KB
testcase_01 AC 11 ms
6,232 KB
testcase_02 AC 12 ms
6,256 KB
testcase_03 AC 12 ms
6,340 KB
testcase_04 AC 11 ms
6,336 KB
testcase_05 AC 11 ms
6,400 KB
testcase_06 AC 11 ms
6,376 KB
testcase_07 AC 11 ms
6,328 KB
testcase_08 AC 12 ms
6,416 KB
testcase_09 AC 11 ms
6,396 KB
testcase_10 AC 11 ms
6,348 KB
testcase_11 AC 12 ms
6,340 KB
testcase_12 AC 11 ms
6,260 KB
testcase_13 AC 12 ms
6,252 KB
testcase_14 AC 11 ms
6,316 KB
testcase_15 AC 11 ms
6,352 KB
testcase_16 AC 11 ms
6,252 KB
testcase_17 AC 11 ms
6,400 KB
testcase_18 AC 11 ms
6,352 KB
testcase_19 AC 11 ms
6,260 KB
testcase_20 AC 11 ms
6,372 KB
testcase_21 AC 11 ms
6,288 KB
testcase_22 AC 11 ms
6,376 KB
testcase_23 AC 12 ms
6,212 KB
testcase_24 WA -
testcase_25 AC 11 ms
6,220 KB
testcase_26 AC 11 ms
6,348 KB
testcase_27 WA -
testcase_28 AC 11 ms
6,352 KB
testcase_29 AC 11 ms
6,264 KB
testcase_30 WA -
testcase_31 AC 11 ms
6,340 KB
testcase_32 AC 11 ms
6,240 KB
testcase_33 AC 11 ms
6,412 KB
testcase_34 AC 12 ms
6,316 KB
testcase_35 WA -
testcase_36 AC 11 ms
6,332 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 11 ms
6,216 KB
testcase_41 AC 11 ms
6,380 KB
testcase_42 AC 11 ms
6,312 KB
testcase_43 AC 11 ms
6,400 KB
testcase_44 AC 11 ms
5,892 KB
testcase_45 AC 11 ms
6,032 KB
testcase_46 AC 11 ms
6,020 KB
testcase_47 AC 11 ms
5,976 KB
testcase_48 AC 11 ms
5,972 KB
testcase_49 AC 11 ms
5,840 KB
testcase_50 AC 11 ms
5,996 KB
testcase_51 AC 11 ms
5,956 KB
testcase_52 AC 11 ms
5,892 KB
testcase_53 AC 11 ms
5,876 KB
testcase_54 AC 11 ms
6,336 KB
testcase_55 AC 11 ms
6,312 KB
testcase_56 AC 12 ms
6,352 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 * p
    for i in [1, 2, 3, 4]:
        res -= s[i] * (1-p**i) * p
    if res < 0:
        res = 0
    return res


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