結果

問題 No.338 アンケート機能
ユーザー nCk_cvnCk_cv
提出日時 2016-02-01 22:05:54
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 648 bytes
コンパイル時間 1,966 ms
コンパイル使用メモリ 74,280 KB
実行使用メモリ 57,696 KB
最終ジャッジ日時 2023-10-21 18:33:50
合計ジャッジ時間 7,023 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,272 KB
testcase_01 AC 118 ms
56,196 KB
testcase_02 AC 133 ms
57,320 KB
testcase_03 AC 132 ms
57,032 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 129 ms
56,940 KB
testcase_09 AC 127 ms
57,244 KB
testcase_10 AC 128 ms
57,440 KB
testcase_11 AC 130 ms
57,324 KB
testcase_12 AC 127 ms
57,000 KB
testcase_13 AC 128 ms
57,232 KB
testcase_14 AC 128 ms
57,012 KB
testcase_15 AC 130 ms
56,976 KB
testcase_16 AC 129 ms
57,192 KB
testcase_17 AC 119 ms
56,164 KB
testcase_18 AC 130 ms
56,944 KB
testcase_19 AC 130 ms
57,536 KB
testcase_20 AC 128 ms
57,436 KB
testcase_21 WA -
testcase_22 AC 127 ms
57,196 KB
testcase_23 AC 128 ms
56,980 KB
testcase_24 AC 128 ms
57,204 KB
testcase_25 AC 127 ms
57,564 KB
testcase_26 AC 131 ms
56,984 KB
testcase_27 AC 130 ms
57,492 KB
testcase_28 AC 128 ms
57,432 KB
testcase_29 AC 128 ms
57,024 KB
testcase_30 AC 128 ms
57,300 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);
		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