結果

問題 No.338 アンケート機能
ユーザー jp_stejp_ste
提出日時 2016-02-16 22:21:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 74,856 KB
実行使用メモリ 57,924 KB
最終ジャッジ日時 2023-10-22 06:02:14
合計ジャッジ時間 7,787 ms
ジャッジサーバーID
(参考情報)
judge10 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,484 KB
testcase_01 AC 140 ms
57,648 KB
testcase_02 AC 132 ms
57,420 KB
testcase_03 AC 132 ms
57,480 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 132 ms
57,468 KB
testcase_09 WA -
testcase_10 AC 135 ms
57,476 KB
testcase_11 AC 136 ms
57,512 KB
testcase_12 AC 135 ms
57,196 KB
testcase_13 AC 136 ms
57,392 KB
testcase_14 AC 138 ms
57,448 KB
testcase_15 AC 136 ms
57,464 KB
testcase_16 AC 136 ms
57,408 KB
testcase_17 AC 141 ms
57,416 KB
testcase_18 AC 140 ms
57,508 KB
testcase_19 AC 138 ms
57,476 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 133 ms
57,436 KB
testcase_24 AC 142 ms
57,704 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 135 ms
57,448 KB
testcase_29 AC 133 ms
57,444 KB
testcase_30 AC 135 ms
57,660 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=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