結果

問題 No.338 アンケート機能
ユーザー nCk_cvnCk_cv
提出日時 2016-02-01 22:09:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 2,746 ms
コンパイル使用メモリ 72,372 KB
実行使用メモリ 57,744 KB
最終ジャッジ日時 2023-08-07 21:36:37
合計ジャッジ時間 6,734 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,552 KB
testcase_01 AC 119 ms
55,828 KB
testcase_02 AC 119 ms
56,064 KB
testcase_03 AC 122 ms
56,012 KB
testcase_04 AC 119 ms
56,088 KB
testcase_05 AC 119 ms
55,896 KB
testcase_06 AC 119 ms
55,584 KB
testcase_07 AC 120 ms
55,572 KB
testcase_08 AC 117 ms
56,088 KB
testcase_09 AC 117 ms
56,304 KB
testcase_10 AC 117 ms
55,800 KB
testcase_11 AC 117 ms
55,816 KB
testcase_12 AC 117 ms
56,112 KB
testcase_13 AC 118 ms
56,140 KB
testcase_14 AC 117 ms
55,540 KB
testcase_15 AC 118 ms
55,800 KB
testcase_16 AC 117 ms
56,516 KB
testcase_17 AC 116 ms
56,208 KB
testcase_18 AC 116 ms
55,796 KB
testcase_19 AC 117 ms
55,936 KB
testcase_20 AC 119 ms
55,928 KB
testcase_21 AC 121 ms
55,544 KB
testcase_22 AC 119 ms
56,136 KB
testcase_23 AC 117 ms
55,980 KB
testcase_24 AC 120 ms
55,780 KB
testcase_25 AC 118 ms
57,744 KB
testcase_26 AC 120 ms
56,128 KB
testcase_27 AC 121 ms
55,860 KB
testcase_28 AC 120 ms
56,152 KB
testcase_29 AC 120 ms
56,160 KB
testcase_30 AC 119 ms
56,200 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