結果

問題 No.338 アンケート機能
ユーザー jp_stejp_ste
提出日時 2016-02-16 22:27:23
言語 Java19
(openjdk 21)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 72,420 KB
実行使用メモリ 56,216 KB
最終ジャッジ日時 2023-08-07 21:38:15
合計ジャッジ時間 7,440 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,892 KB
testcase_01 AC 128 ms
55,808 KB
testcase_02 AC 129 ms
55,740 KB
testcase_03 AC 127 ms
55,728 KB
testcase_04 AC 128 ms
55,760 KB
testcase_05 AC 128 ms
55,756 KB
testcase_06 AC 126 ms
55,520 KB
testcase_07 AC 128 ms
55,556 KB
testcase_08 AC 129 ms
56,052 KB
testcase_09 AC 126 ms
55,472 KB
testcase_10 AC 129 ms
55,520 KB
testcase_11 AC 129 ms
55,820 KB
testcase_12 AC 127 ms
55,696 KB
testcase_13 AC 128 ms
56,116 KB
testcase_14 AC 127 ms
55,856 KB
testcase_15 AC 128 ms
55,972 KB
testcase_16 AC 128 ms
56,012 KB
testcase_17 AC 130 ms
55,752 KB
testcase_18 AC 130 ms
56,216 KB
testcase_19 AC 130 ms
56,116 KB
testcase_20 AC 135 ms
55,764 KB
testcase_21 AC 129 ms
55,512 KB
testcase_22 AC 129 ms
56,080 KB
testcase_23 AC 129 ms
56,204 KB
testcase_24 AC 130 ms
56,080 KB
testcase_25 AC 130 ms
55,712 KB
testcase_26 AC 127 ms
55,868 KB
testcase_27 AC 128 ms
55,808 KB
testcase_28 AC 129 ms
55,760 KB
testcase_29 AC 128 ms
55,824 KB
testcase_30 AC 126 ms
55,500 KB
権限があれば一括ダウンロードができます

ソースコード

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