結果

問題 No.338 アンケート機能
ユーザー GrenacheGrenache
提出日時 2016-02-15 21:08:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 75,408 KB
実行使用メモリ 54,444 KB
最終ジャッジ日時 2024-04-25 15:54:23
合計ジャッジ時間 7,583 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
54,444 KB
testcase_01 AC 122 ms
54,028 KB
testcase_02 AC 113 ms
53,080 KB
testcase_03 AC 116 ms
52,972 KB
testcase_04 AC 121 ms
54,180 KB
testcase_05 AC 125 ms
54,168 KB
testcase_06 AC 126 ms
54,108 KB
testcase_07 AC 117 ms
53,192 KB
testcase_08 AC 123 ms
54,108 KB
testcase_09 AC 122 ms
53,800 KB
testcase_10 AC 126 ms
54,040 KB
testcase_11 AC 125 ms
54,320 KB
testcase_12 AC 118 ms
54,272 KB
testcase_13 AC 122 ms
54,408 KB
testcase_14 AC 118 ms
54,024 KB
testcase_15 AC 106 ms
53,028 KB
testcase_16 AC 114 ms
54,300 KB
testcase_17 AC 115 ms
53,832 KB
testcase_18 AC 123 ms
54,180 KB
testcase_19 AC 110 ms
53,012 KB
testcase_20 AC 110 ms
54,324 KB
testcase_21 AC 117 ms
53,592 KB
testcase_22 AC 119 ms
54,044 KB
testcase_23 AC 106 ms
52,904 KB
testcase_24 AC 123 ms
54,120 KB
testcase_25 AC 109 ms
53,272 KB
testcase_26 AC 114 ms
54,024 KB
testcase_27 AC 117 ms
53,496 KB
testcase_28 AC 108 ms
53,028 KB
testcase_29 AC 115 ms
53,944 KB
testcase_30 AC 113 ms
53,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder338 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();

        int min = Integer.MAX_VALUE;
        for (int i = 0; i <= 200; i++) {
            for (int j = 0; j <= 200; j++) {
            	int tmp = i + j;
            	if (tmp == 0) {
            		continue;
            	}

            	int tmpa = (int)Math.round((double)100 * i / tmp);
            	int tmpb = (int)Math.round((double)100 * j / tmp);

            	if (tmpa == a && tmpb == b) {
            		min = Math.min(min, tmp);
            	}
            }
        }

        System.out.println(min);

        sc.close();
    }
}
0