結果

問題 No.338 アンケート機能
ユーザー Grenache
提出日時 2016-02-15 21:08:33
言語 Java
(openjdk 23)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 3,600 ms
コンパイル使用メモリ 74,528 KB
実行使用メモリ 41,588 KB
最終ジャッジ日時 2024-11-08 03:02:22
合計ジャッジ時間 9,053 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

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