結果

問題 No.1807 UMA Gacha
ユーザー bluemeganebluemegane
提出日時 2022-01-15 11:38:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 2,203 ms
コンパイル使用メモリ 101,760 KB
実行使用メモリ 27,428 KB
最終ジャッジ日時 2024-05-01 07:59:07
合計ジャッジ時間 3,857 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
27,304 KB
testcase_01 AC 26 ms
27,056 KB
testcase_02 AC 24 ms
23,764 KB
testcase_03 AC 23 ms
23,516 KB
testcase_04 AC 28 ms
27,308 KB
testcase_05 AC 26 ms
25,052 KB
testcase_06 AC 27 ms
27,428 KB
testcase_07 AC 26 ms
25,004 KB
testcase_08 AC 27 ms
23,348 KB
testcase_09 AC 25 ms
25,380 KB
testcase_10 AC 27 ms
25,264 KB
testcase_11 AC 26 ms
25,004 KB
testcase_12 AC 24 ms
23,772 KB
testcase_13 AC 23 ms
21,552 KB
testcase_14 AC 23 ms
25,676 KB
testcase_15 AC 27 ms
26,904 KB
testcase_16 AC 26 ms
25,260 KB
testcase_17 AC 26 ms
25,308 KB
testcase_18 AC 25 ms
25,308 KB
testcase_19 AC 26 ms
25,264 KB
testcase_20 AC 26 ms
25,052 KB
testcase_21 AC 27 ms
24,920 KB
testcase_22 AC 23 ms
23,388 KB
testcase_23 AC 23 ms
23,772 KB
testcase_24 AC 23 ms
23,768 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

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