結果

問題 No.787 Mice and Traitors(ネズミ達と裏切り者)
ユーザー GrenacheGrenache
提出日時 2019-05-02 22:33:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 5,332 ms
コンパイル使用メモリ 73,072 KB
実行使用メモリ 56,480 KB
最終ジャッジ日時 2023-08-30 04:54:48
合計ジャッジ時間 7,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
55,868 KB
testcase_01 AC 144 ms
56,064 KB
testcase_02 AC 142 ms
56,196 KB
testcase_03 AC 142 ms
56,424 KB
testcase_04 AC 141 ms
55,776 KB
testcase_05 AC 144 ms
56,480 KB
testcase_06 AC 144 ms
55,948 KB
testcase_07 AC 142 ms
56,160 KB
testcase_08 AC 143 ms
56,000 KB
testcase_09 AC 141 ms
56,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.Scanner;


public class Main_yukicoder787 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		double p = sc.nextDouble();
		double q = sc.nextDouble();

		double u = p * q;
		double nu = (100 - p) * (100 - q);

		if (p == 0) {
			pr.println(0);
		} else {
			pr.printf("%.7f%n", u / (nu + u) * 100);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0