結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,424 KB
testcase_01 AC 129 ms
57,296 KB
testcase_02 AC 130 ms
57,256 KB
testcase_03 AC 129 ms
57,512 KB
testcase_04 AC 127 ms
57,500 KB
testcase_05 WA -
testcase_06 AC 129 ms
57,476 KB
testcase_07 WA -
testcase_08 AC 130 ms
57,616 KB
testcase_09 AC 130 ms
57,432 KB
testcase_10 AC 130 ms
57,404 KB
testcase_11 AC 127 ms
57,488 KB
testcase_12 AC 130 ms
57,480 KB
testcase_13 AC 130 ms
57,280 KB
testcase_14 AC 130 ms
57,348 KB
testcase_15 AC 127 ms
57,452 KB
testcase_16 AC 131 ms
57,260 KB
testcase_17 AC 129 ms
57,420 KB
testcase_18 AC 130 ms
57,428 KB
testcase_19 AC 127 ms
57,288 KB
testcase_20 AC 128 ms
57,024 KB
testcase_21 WA -
testcase_22 AC 129 ms
57,240 KB
testcase_23 AC 141 ms
57,444 KB
testcase_24 AC 136 ms
57,392 KB
testcase_25 AC 128 ms
57,224 KB
testcase_26 AC 125 ms
57,208 KB
testcase_27 AC 131 ms
57,248 KB
testcase_28 AC 127 ms
57,328 KB
testcase_29 AC 130 ms
57,376 KB
testcase_30 AC 130 ms
57,268 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;
		}
		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