結果

問題 No.338 アンケート機能
ユーザー jp_ste
提出日時 2016-02-16 22:21:21
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 2,232 ms
コンパイル使用メモリ 74,540 KB
実行使用メモリ 54,456 KB
最終ジャッジ日時 2024-09-22 07:19:22
合計ジャッジ時間 7,551 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int ans = Integer.MAX_VALUE;
		
		for(int a=1; a<=100; a++) {
			for(int b=1; b<=100; b++) {
				int tmpA =  Math.round((100f * a / (a+b)));
				int tmpB =  Math.round((100f * b / (a+b)));
				if(A == tmpA && B == tmpB) {
					ans = Math.min(ans, a+b);
				}
			}
		}
		System.out.println(ans);
	}
}
0