結果

問題 No.338 アンケート機能
ユーザー nCk_cvnCk_cv
提出日時 2016-02-01 22:09:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 2,163 ms
コンパイル使用メモリ 74,856 KB
実行使用メモリ 54,476 KB
最終ジャッジ日時 2024-04-25 15:53:04
合計ジャッジ時間 6,719 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
54,336 KB
testcase_01 AC 123 ms
53,680 KB
testcase_02 AC 113 ms
52,740 KB
testcase_03 AC 126 ms
54,028 KB
testcase_04 AC 125 ms
54,004 KB
testcase_05 AC 127 ms
54,052 KB
testcase_06 AC 127 ms
54,148 KB
testcase_07 AC 128 ms
53,884 KB
testcase_08 AC 126 ms
54,096 KB
testcase_09 AC 126 ms
54,220 KB
testcase_10 AC 126 ms
54,188 KB
testcase_11 AC 126 ms
54,156 KB
testcase_12 AC 125 ms
54,160 KB
testcase_13 AC 124 ms
54,040 KB
testcase_14 AC 123 ms
54,188 KB
testcase_15 AC 114 ms
53,420 KB
testcase_16 AC 125 ms
54,164 KB
testcase_17 AC 122 ms
54,196 KB
testcase_18 AC 122 ms
53,944 KB
testcase_19 AC 121 ms
54,040 KB
testcase_20 AC 109 ms
52,920 KB
testcase_21 AC 124 ms
54,156 KB
testcase_22 AC 133 ms
54,292 KB
testcase_23 AC 127 ms
53,852 KB
testcase_24 AC 121 ms
54,364 KB
testcase_25 AC 113 ms
54,232 KB
testcase_26 AC 112 ms
53,056 KB
testcase_27 AC 123 ms
54,236 KB
testcase_28 AC 112 ms
52,904 KB
testcase_29 AC 123 ms
54,476 KB
testcase_30 AC 124 ms
54,060 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();
		int MAX = Integer.MAX_VALUE;
		for(int i = 0;i < MAX ; i++) {
			for(int j = 0; i + j < MAX; j++) {
				if(i + j == 0) continue;
				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