結果

問題 No.338 アンケート機能
ユーザー YamaKasaYamaKasa
提出日時 2018-09-16 17:08:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 3,546 ms
コンパイル使用メモリ 71,376 KB
実行使用メモリ 56,120 KB
最終ジャッジ日時 2023-09-25 09:01:42
合計ジャッジ時間 8,293 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
55,804 KB
testcase_01 AC 138 ms
55,800 KB
testcase_02 AC 135 ms
55,680 KB
testcase_03 AC 137 ms
55,732 KB
testcase_04 AC 132 ms
55,828 KB
testcase_05 AC 134 ms
55,924 KB
testcase_06 AC 133 ms
55,544 KB
testcase_07 AC 134 ms
53,988 KB
testcase_08 AC 135 ms
55,824 KB
testcase_09 AC 133 ms
54,056 KB
testcase_10 AC 141 ms
55,728 KB
testcase_11 AC 131 ms
56,112 KB
testcase_12 AC 134 ms
55,816 KB
testcase_13 AC 140 ms
55,808 KB
testcase_14 AC 133 ms
55,804 KB
testcase_15 AC 131 ms
55,812 KB
testcase_16 AC 132 ms
55,868 KB
testcase_17 AC 131 ms
55,824 KB
testcase_18 AC 136 ms
55,468 KB
testcase_19 AC 136 ms
55,508 KB
testcase_20 AC 134 ms
55,800 KB
testcase_21 AC 132 ms
55,984 KB
testcase_22 AC 132 ms
55,764 KB
testcase_23 AC 131 ms
55,944 KB
testcase_24 AC 132 ms
56,120 KB
testcase_25 AC 133 ms
55,984 KB
testcase_26 AC 134 ms
55,544 KB
testcase_27 AC 132 ms
55,812 KB
testcase_28 AC 139 ms
56,052 KB
testcase_29 AC 149 ms
55,788 KB
testcase_30 AC 132 ms
55,816 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();
		scan.close();
		if(A < B) {
			int t = A;
			A = B;
			B = t;
		}
		int min = 200;
		for(int a = 1; a <= 100; a++) {
			for(int b = 0; b <= 100; b++) {
				double k1 = (double) 100 * a / (a + b);
				double k2 = (double) 100 * b / (a + b);
				int k3 = (int)Math.round(k1);
				int k4 = (int)Math.round(k2);
				if(k3 == A && k4 == B) {
					if(min > a + b) {
						min = a + b;
					}
				}
			}
		}
		System.out.println(min);
	}
}
0