結果

問題 No.338 アンケート機能
ユーザー jp_stejp_ste
提出日時 2016-02-16 22:27:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 78,760 KB
実行使用メモリ 56,120 KB
最終ジャッジ日時 2024-04-25 15:54:34
合計ジャッジ時間 6,865 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,160 KB
testcase_01 AC 127 ms
53,964 KB
testcase_02 AC 127 ms
54,276 KB
testcase_03 AC 128 ms
54,424 KB
testcase_04 AC 124 ms
54,292 KB
testcase_05 AC 123 ms
54,232 KB
testcase_06 AC 124 ms
54,340 KB
testcase_07 AC 126 ms
54,316 KB
testcase_08 AC 111 ms
53,112 KB
testcase_09 AC 122 ms
54,184 KB
testcase_10 AC 122 ms
54,204 KB
testcase_11 AC 126 ms
54,532 KB
testcase_12 AC 123 ms
54,156 KB
testcase_13 AC 128 ms
53,980 KB
testcase_14 AC 127 ms
53,996 KB
testcase_15 AC 125 ms
54,152 KB
testcase_16 AC 124 ms
54,232 KB
testcase_17 AC 112 ms
53,156 KB
testcase_18 AC 123 ms
54,088 KB
testcase_19 AC 124 ms
56,120 KB
testcase_20 AC 124 ms
54,428 KB
testcase_21 AC 129 ms
54,312 KB
testcase_22 AC 126 ms
54,016 KB
testcase_23 AC 127 ms
54,112 KB
testcase_24 AC 127 ms
53,856 KB
testcase_25 AC 126 ms
53,988 KB
testcase_26 AC 125 ms
54,340 KB
testcase_27 AC 130 ms
54,288 KB
testcase_28 AC 112 ms
53,188 KB
testcase_29 AC 123 ms
54,312 KB
testcase_30 AC 115 ms
53,212 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