結果

問題 No.787 Mice and Traitors(ネズミ達と裏切り者)
ユーザー Grenache
提出日時 2019-05-02 22:33:07
言語 Java
(openjdk 23)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 3,839 ms
コンパイル使用メモリ 75,104 KB
実行使用メモリ 54,720 KB
最終ジャッジ日時 2024-12-31 13:45:50
合計ジャッジ時間 6,422 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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