結果

問題 No.1807 UMA Gacha
ユーザー bluemegane
提出日時 2022-01-15 11:38:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 2,518 ms
コンパイル使用メモリ 102,784 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-11-21 10:51:41
合計ジャッジ時間 3,821 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
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