結果

問題 No.959 tree and fire
ユーザー keymoonkeymoon
提出日時 2021-02-02 03:06:30
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,051 bytes
コンパイル時間 3,044 ms
コンパイル使用メモリ 105,108 KB
実行使用メモリ 26,532 KB
最終ジャッジ日時 2023-09-12 10:58:30
合計ジャッジ時間 8,644 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 84 ms
24,208 KB
testcase_02 AC 70 ms
24,312 KB
testcase_03 AC 71 ms
24,204 KB
testcase_04 AC 71 ms
24,172 KB
testcase_05 AC 71 ms
24,372 KB
testcase_06 AC 71 ms
24,352 KB
testcase_07 AC 71 ms
24,280 KB
testcase_08 AC 69 ms
22,284 KB
testcase_09 AC 71 ms
24,328 KB
testcase_10 AC 71 ms
26,148 KB
testcase_11 AC 70 ms
24,324 KB
testcase_12 AC 70 ms
24,348 KB
testcase_13 AC 71 ms
26,248 KB
testcase_14 AC 70 ms
24,324 KB
testcase_15 AC 70 ms
24,376 KB
testcase_16 AC 71 ms
26,268 KB
testcase_17 AC 71 ms
24,264 KB
testcase_18 AC 71 ms
24,136 KB
testcase_19 AC 72 ms
24,516 KB
testcase_20 AC 71 ms
26,348 KB
testcase_21 AC 70 ms
24,256 KB
testcase_22 AC 70 ms
24,436 KB
testcase_23 AC 71 ms
24,312 KB
testcase_24 AC 71 ms
24,232 KB
testcase_25 AC 71 ms
24,212 KB
testcase_26 AC 71 ms
26,276 KB
testcase_27 AC 71 ms
24,244 KB
testcase_28 AC 72 ms
24,224 KB
testcase_29 AC 71 ms
24,344 KB
testcase_30 AC 71 ms
24,312 KB
testcase_31 AC 72 ms
26,440 KB
testcase_32 AC 72 ms
26,252 KB
testcase_33 AC 71 ms
24,368 KB
testcase_34 AC 71 ms
22,096 KB
testcase_35 AC 70 ms
24,276 KB
testcase_36 AC 70 ms
24,432 KB
testcase_37 AC 71 ms
26,532 KB
testcase_38 AC 71 ms
24,300 KB
testcase_39 AC 71 ms
24,220 KB
testcase_40 AC 71 ms
22,192 KB
testcase_41 AC 71 ms
24,292 KB
testcase_42 AC 71 ms
26,364 KB
testcase_43 AC 71 ms
24,328 KB
testcase_44 AC 69 ms
24,236 KB
testcase_45 AC 68 ms
24,188 KB
testcase_46 AC 68 ms
22,236 KB
testcase_47 AC 67 ms
22,188 KB
testcase_48 AC 68 ms
22,248 KB
testcase_49 AC 71 ms
26,224 KB
testcase_50 AC 72 ms
24,080 KB
testcase_51 AC 71 ms
22,192 KB
testcase_52 AC 71 ms
24,228 KB
testcase_53 AC 71 ms
24,196 KB
testcase_54 AC 70 ms
24,276 KB
testcase_55 AC 71 ms
22,120 KB
testcase_56 AC 70 ms
26,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

public static class P
{
    public static void Main()
    {
        var nm = Console.ReadLine().Split().Select(long.Parse).ToArray();
        var n = nm.Min();
        var m = nm.Max();
        var p = double.Parse(Console.ReadLine());
        var cnts = new long[5];
        if (n == 1)
        {
            if (m == 1)
            {
                Console.WriteLine(0);
                return;
            }
            cnts[1] = 2;
            cnts[2] = m - 2;
        }
        else
        {
            cnts[2] = 4;
            cnts[3] = (n - 2) * 2 + (m - 2) * 2;
            cnts[4] = (n - 2) * (m - 2);
        }
        double res = 0;
        for (int i = 0; i < cnts.Length; i++)
            res += p * Pow(p, i) * cnts[i];
        Console.WriteLine(res);
    }
}
0