結果

問題 No.1807 UMA Gacha
ユーザー bluemeganebluemegane
提出日時 2022-01-15 11:38:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 946 ms
コンパイル使用メモリ 63,332 KB
実行使用メモリ 25,268 KB
最終ジャッジ日時 2023-08-13 15:07:16
合計ジャッジ時間 4,125 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
24,968 KB
testcase_01 AC 63 ms
21,196 KB
testcase_02 AC 58 ms
20,904 KB
testcase_03 AC 58 ms
22,660 KB
testcase_04 AC 63 ms
22,896 KB
testcase_05 AC 63 ms
23,028 KB
testcase_06 AC 64 ms
25,268 KB
testcase_07 AC 64 ms
23,248 KB
testcase_08 AC 65 ms
25,252 KB
testcase_09 AC 63 ms
25,164 KB
testcase_10 AC 63 ms
23,268 KB
testcase_11 AC 63 ms
25,148 KB
testcase_12 AC 59 ms
20,704 KB
testcase_13 AC 59 ms
20,640 KB
testcase_14 AC 58 ms
18,708 KB
testcase_15 AC 63 ms
23,204 KB
testcase_16 AC 64 ms
23,216 KB
testcase_17 AC 63 ms
23,292 KB
testcase_18 AC 64 ms
23,164 KB
testcase_19 AC 65 ms
23,164 KB
testcase_20 AC 65 ms
25,156 KB
testcase_21 AC 65 ms
23,212 KB
testcase_22 AC 59 ms
20,832 KB
testcase_23 AC 57 ms
20,752 KB
testcase_24 AC 58 ms
20,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using static System.Math;
using System;

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var p = double.Parse(Console.ReadLine().Trim());
        getAns(n, p);
    }
    static void getAns(int n, double p)
    {
        if (n >= 200) Console.WriteLine(1);
        else
        {
            var pb = 1d - p;
            var ans = 1d - (Pow(pb, n));
            Console.WriteLine(ans);
        }
    }
}
0