結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
57,284 KB
testcase_01 AC 134 ms
56,956 KB
testcase_02 AC 135 ms
57,476 KB
testcase_03 AC 135 ms
57,276 KB
testcase_04 WA -
testcase_05 AC 134 ms
56,968 KB
testcase_06 AC 134 ms
57,436 KB
testcase_07 AC 135 ms
57,280 KB
testcase_08 AC 135 ms
57,476 KB
testcase_09 AC 134 ms
57,340 KB
testcase_10 AC 133 ms
57,240 KB
testcase_11 AC 131 ms
57,232 KB
testcase_12 AC 134 ms
57,496 KB
testcase_13 AC 133 ms
57,424 KB
testcase_14 AC 133 ms
57,196 KB
testcase_15 AC 132 ms
57,224 KB
testcase_16 AC 130 ms
57,392 KB
testcase_17 AC 131 ms
57,300 KB
testcase_18 AC 132 ms
57,176 KB
testcase_19 AC 134 ms
57,252 KB
testcase_20 AC 132 ms
57,248 KB
testcase_21 AC 134 ms
57,148 KB
testcase_22 AC 133 ms
57,308 KB
testcase_23 AC 131 ms
57,420 KB
testcase_24 AC 133 ms
57,412 KB
testcase_25 AC 133 ms
57,332 KB
testcase_26 AC 134 ms
57,416 KB
testcase_27 AC 135 ms
57,308 KB
testcase_28 AC 139 ms
56,940 KB
testcase_29 AC 134 ms
57,400 KB
testcase_30 AC 132 ms
57,244 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 == 0 && b == 0) {
			System.out.println(0);
			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