結果

問題 No.339 何人が回答したのか
ユーザー samplelpmassamplelpmas
提出日時 2017-04-21 16:01:13
言語 Java19
(openjdk 21)
結果
AC  
実行時間 137 ms / 1,000 ms
コード長 525 bytes
コンパイル時間 3,085 ms
コンパイル使用メモリ 72,512 KB
実行使用メモリ 56,184 KB
最終ジャッジ日時 2023-09-27 10:53:26
合計ジャッジ時間 14,331 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
55,832 KB
testcase_01 AC 132 ms
55,716 KB
testcase_02 AC 125 ms
55,536 KB
testcase_03 AC 123 ms
55,400 KB
testcase_04 AC 125 ms
55,792 KB
testcase_05 AC 126 ms
55,744 KB
testcase_06 AC 126 ms
55,880 KB
testcase_07 AC 127 ms
55,772 KB
testcase_08 AC 125 ms
55,648 KB
testcase_09 AC 127 ms
55,600 KB
testcase_10 AC 127 ms
55,716 KB
testcase_11 AC 127 ms
55,744 KB
testcase_12 AC 128 ms
55,944 KB
testcase_13 AC 127 ms
55,776 KB
testcase_14 AC 127 ms
55,980 KB
testcase_15 AC 125 ms
55,820 KB
testcase_16 AC 127 ms
55,556 KB
testcase_17 AC 130 ms
55,448 KB
testcase_18 AC 128 ms
55,724 KB
testcase_19 AC 127 ms
55,940 KB
testcase_20 AC 129 ms
55,820 KB
testcase_21 AC 126 ms
55,720 KB
testcase_22 AC 127 ms
55,644 KB
testcase_23 AC 128 ms
55,952 KB
testcase_24 AC 126 ms
55,412 KB
testcase_25 AC 128 ms
55,556 KB
testcase_26 AC 126 ms
55,712 KB
testcase_27 AC 130 ms
55,760 KB
testcase_28 AC 127 ms
56,020 KB
testcase_29 AC 126 ms
55,920 KB
testcase_30 AC 127 ms
55,676 KB
testcase_31 AC 129 ms
55,568 KB
testcase_32 AC 127 ms
55,588 KB
testcase_33 AC 127 ms
55,720 KB
testcase_34 AC 125 ms
55,504 KB
testcase_35 AC 128 ms
55,720 KB
testcase_36 AC 127 ms
55,764 KB
testcase_37 AC 127 ms
55,484 KB
testcase_38 AC 124 ms
55,720 KB
testcase_39 AC 126 ms
53,356 KB
testcase_40 AC 127 ms
55,404 KB
testcase_41 AC 126 ms
55,752 KB
testcase_42 AC 127 ms
55,560 KB
testcase_43 AC 127 ms
56,096 KB
testcase_44 AC 127 ms
55,980 KB
testcase_45 AC 127 ms
55,724 KB
testcase_46 AC 127 ms
55,408 KB
testcase_47 AC 126 ms
55,868 KB
testcase_48 AC 127 ms
55,868 KB
testcase_49 AC 128 ms
55,932 KB
testcase_50 AC 127 ms
55,488 KB
testcase_51 AC 128 ms
56,168 KB
testcase_52 AC 129 ms
55,672 KB
testcase_53 AC 129 ms
56,140 KB
testcase_54 AC 127 ms
55,616 KB
testcase_55 AC 126 ms
55,928 KB
testcase_56 AC 127 ms
56,184 KB
testcase_57 AC 127 ms
55,736 KB
testcase_58 AC 126 ms
55,736 KB
testcase_59 AC 125 ms
55,776 KB
testcase_60 AC 126 ms
55,992 KB
testcase_61 AC 124 ms
55,716 KB
testcase_62 AC 123 ms
55,716 KB
testcase_63 AC 124 ms
55,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int gcd = 100;

        for (int i = 0; i < n; i++) {

            gcd = gcd(gcd, sc.nextInt());

        }

        System.out.println(100 / gcd);

    }

    private static int gcd(int a, int b) {

        while (b > 0) {

            int remainder = a % b;
            a = b;
            b = remainder;

        }

        return a;

    }

}
0