結果

問題 No.787 Mice and Traitors(ネズミ達と裏切り者)
ユーザー tentententen
提出日時 2020-11-19 08:54:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 2,348 ms
コンパイル使用メモリ 71,916 KB
実行使用メモリ 56,960 KB
最終ジャッジ日時 2023-09-30 15:44:38
合計ジャッジ時間 4,243 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
56,280 KB
testcase_01 AC 135 ms
56,168 KB
testcase_02 AC 134 ms
56,960 KB
testcase_03 AC 133 ms
56,320 KB
testcase_04 AC 133 ms
56,348 KB
testcase_05 AC 138 ms
56,268 KB
testcase_06 AC 134 ms
56,880 KB
testcase_07 AC 134 ms
55,816 KB
testcase_08 AC 134 ms
56,456 KB
testcase_09 AC 132 ms
56,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double p = sc.nextDouble() / 100.0;
        double q = sc.nextDouble() / 100.0;
        double mother = p * q + (1 - p) * (1 - q);
        double ans = p * q / mother;
        System.out.println(java.math.BigDecimal.valueOf(ans * 100).toPlainString());
    }
}
0