結果

問題 No.339 何人が回答したのか
ユーザー atkrymatkrym
提出日時 2016-10-19 17:01:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 549 bytes
コンパイル時間 2,959 ms
コンパイル使用メモリ 71,244 KB
実行使用メモリ 39,948 KB
最終ジャッジ日時 2023-08-14 17:39:42
合計ジャッジ時間 14,194 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
39,732 KB
testcase_01 AC 120 ms
39,312 KB
testcase_02 AC 107 ms
38,992 KB
testcase_03 AC 113 ms
39,428 KB
testcase_04 AC 119 ms
39,520 KB
testcase_05 AC 114 ms
39,140 KB
testcase_06 AC 120 ms
39,364 KB
testcase_07 AC 119 ms
39,192 KB
testcase_08 AC 119 ms
39,652 KB
testcase_09 AC 118 ms
39,100 KB
testcase_10 AC 114 ms
39,052 KB
testcase_11 AC 117 ms
39,120 KB
testcase_12 AC 116 ms
39,264 KB
testcase_13 AC 118 ms
39,420 KB
testcase_14 AC 117 ms
39,172 KB
testcase_15 AC 114 ms
39,412 KB
testcase_16 AC 109 ms
39,056 KB
testcase_17 AC 114 ms
39,424 KB
testcase_18 AC 113 ms
39,604 KB
testcase_19 AC 120 ms
38,948 KB
testcase_20 AC 122 ms
39,044 KB
testcase_21 AC 128 ms
39,352 KB
testcase_22 AC 115 ms
39,456 KB
testcase_23 AC 116 ms
39,128 KB
testcase_24 AC 118 ms
39,948 KB
testcase_25 AC 115 ms
39,488 KB
testcase_26 AC 117 ms
39,336 KB
testcase_27 AC 114 ms
39,140 KB
testcase_28 AC 117 ms
39,028 KB
testcase_29 AC 117 ms
39,364 KB
testcase_30 AC 118 ms
39,128 KB
testcase_31 AC 114 ms
39,604 KB
testcase_32 AC 116 ms
39,084 KB
testcase_33 AC 112 ms
39,296 KB
testcase_34 AC 121 ms
39,312 KB
testcase_35 AC 112 ms
39,256 KB
testcase_36 AC 114 ms
39,416 KB
testcase_37 AC 112 ms
39,492 KB
testcase_38 AC 113 ms
39,060 KB
testcase_39 AC 114 ms
38,960 KB
testcase_40 AC 112 ms
39,076 KB
testcase_41 AC 111 ms
38,884 KB
testcase_42 AC 114 ms
39,216 KB
testcase_43 AC 112 ms
39,472 KB
testcase_44 AC 111 ms
39,280 KB
testcase_45 AC 111 ms
38,964 KB
testcase_46 AC 115 ms
39,340 KB
testcase_47 AC 113 ms
39,496 KB
testcase_48 AC 113 ms
39,112 KB
testcase_49 AC 111 ms
38,820 KB
testcase_50 AC 114 ms
39,328 KB
testcase_51 AC 115 ms
39,032 KB
testcase_52 AC 109 ms
39,560 KB
testcase_53 AC 110 ms
38,968 KB
testcase_54 AC 112 ms
39,336 KB
testcase_55 AC 115 ms
39,408 KB
testcase_56 AC 115 ms
39,072 KB
testcase_57 AC 112 ms
39,188 KB
testcase_58 AC 119 ms
39,676 KB
testcase_59 AC 115 ms
39,120 KB
testcase_60 AC 116 ms
39,528 KB
testcase_61 AC 109 ms
39,044 KB
testcase_62 AC 123 ms
39,448 KB
testcase_63 AC 115 ms
39,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int gcd = sc.nextInt();
        for (int i = 1;i < n;i++) {
            gcd = gcd(gcd, sc.nextInt());
        }
        System.out.println(100/gcd);
    }
    
    private static int gcd(int a, int b) {
        int temp;
        while (b % a != 0) {
            temp = a;
            a = b % a;
            b = temp;
        }
        return a;
    }
}
0