結果

問題 No.1807 UMA Gacha
ユーザー viral8viral8
提出日時 2022-10-01 08:22:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 56,460 KB
最終ジャッジ日時 2023-08-25 01:17:23
合計ジャッジ時間 6,014 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
56,324 KB
testcase_01 AC 134 ms
55,948 KB
testcase_02 AC 115 ms
55,852 KB
testcase_03 AC 115 ms
55,868 KB
testcase_04 AC 131 ms
56,132 KB
testcase_05 AC 130 ms
56,268 KB
testcase_06 AC 129 ms
56,260 KB
testcase_07 AC 132 ms
56,460 KB
testcase_08 AC 128 ms
54,576 KB
testcase_09 AC 129 ms
55,880 KB
testcase_10 AC 127 ms
56,184 KB
testcase_11 AC 128 ms
54,492 KB
testcase_12 AC 113 ms
55,964 KB
testcase_13 AC 116 ms
56,232 KB
testcase_14 AC 116 ms
56,176 KB
testcase_15 AC 128 ms
56,140 KB
testcase_16 AC 127 ms
56,256 KB
testcase_17 AC 125 ms
55,888 KB
testcase_18 AC 128 ms
55,956 KB
testcase_19 AC 128 ms
56,132 KB
testcase_20 AC 127 ms
56,144 KB
testcase_21 AC 127 ms
56,360 KB
testcase_22 AC 113 ms
56,208 KB
testcase_23 AC 118 ms
55,376 KB
testcase_24 AC 116 ms
56,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        if(N>=200){
            System.out.println(1);
            return;
        }
        double P = sc.nextDouble();
        double ans = 1-P;
        while(--N>0){
            ans *= 1-P;
        }
        System.out.println(1-ans);
    }
}
0