結果

問題 No.338 アンケート機能
ユーザー jp_ste
提出日時 2016-02-16 22:27:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 2,498 ms
コンパイル使用メモリ 74,788 KB
実行使用メモリ 41,812 KB
最終ジャッジ日時 2024-11-08 03:02:33
合計ジャッジ時間 7,771 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

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=0; a<=200; a++) {
			for(int b=0; b<=200; 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