結果

問題 No.338 アンケート機能
ユーザー nCk_cvnCk_cv
提出日時 2016-02-01 22:06:46
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 668 bytes
コンパイル時間 2,260 ms
コンパイル使用メモリ 77,292 KB
実行使用メモリ 57,584 KB
最終ジャッジ日時 2023-10-21 18:34:31
合計ジャッジ時間 7,418 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
57,240 KB
testcase_01 AC 120 ms
56,228 KB
testcase_02 AC 131 ms
57,476 KB
testcase_03 AC 131 ms
57,332 KB
testcase_04 AC 130 ms
57,224 KB
testcase_05 WA -
testcase_06 AC 133 ms
57,276 KB
testcase_07 WA -
testcase_08 AC 135 ms
57,508 KB
testcase_09 AC 132 ms
57,344 KB
testcase_10 AC 131 ms
57,504 KB
testcase_11 AC 131 ms
57,220 KB
testcase_12 AC 131 ms
57,228 KB
testcase_13 AC 129 ms
57,404 KB
testcase_14 AC 131 ms
57,264 KB
testcase_15 AC 130 ms
57,300 KB
testcase_16 AC 131 ms
57,296 KB
testcase_17 AC 130 ms
57,432 KB
testcase_18 AC 132 ms
57,384 KB
testcase_19 AC 130 ms
56,952 KB
testcase_20 AC 132 ms
57,584 KB
testcase_21 WA -
testcase_22 AC 138 ms
57,264 KB
testcase_23 AC 129 ms
57,468 KB
testcase_24 AC 130 ms
57,484 KB
testcase_25 AC 131 ms
57,276 KB
testcase_26 AC 130 ms
57,456 KB
testcase_27 AC 129 ms
55,524 KB
testcase_28 AC 130 ms
56,964 KB
testcase_29 AC 130 ms
57,540 KB
testcase_30 AC 133 ms
57,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
import java.io.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a == 100 || b == 100) {
			System.out.println(1);
			return;
		}
		int MAX = Integer.MAX_VALUE;
		for(int i = 1;i < MAX ; i++) {
			for(int j = 0; i + j < MAX; j++) {
				double Aa = 100 * i / (double)(i + j);
				double Bb = 100 * j / (double)(i + j);
				int A = (int)Aa;
				int B = (int)Bb; 
				
				if(Aa - A >= 0.5) A++;
				if(Bb - B >= 0.5) B++;
				if(A == a && B == b) MAX = i + j;
				if(A < a) break;
			}
		}
		System.out.println(MAX);
	}
}
0