結果

問題 No.339 何人が回答したのか
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-16 21:23:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 731 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 71,984 KB
実行使用メモリ 56,680 KB
最終ジャッジ日時 2023-08-17 07:34:34
合計ジャッジ時間 11,700 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,488 KB
testcase_01 AC 119 ms
55,688 KB
testcase_02 AC 113 ms
55,908 KB
testcase_03 AC 116 ms
55,992 KB
testcase_04 AC 115 ms
55,976 KB
testcase_05 AC 112 ms
55,836 KB
testcase_06 AC 115 ms
56,680 KB
testcase_07 AC 116 ms
55,656 KB
testcase_08 AC 115 ms
55,740 KB
testcase_09 AC 113 ms
55,752 KB
testcase_10 AC 114 ms
55,924 KB
testcase_11 AC 113 ms
55,672 KB
testcase_12 AC 115 ms
55,792 KB
testcase_13 AC 118 ms
55,880 KB
testcase_14 AC 113 ms
55,716 KB
testcase_15 AC 118 ms
55,872 KB
testcase_16 AC 118 ms
56,064 KB
testcase_17 AC 119 ms
56,292 KB
testcase_18 AC 115 ms
55,752 KB
testcase_19 AC 116 ms
55,936 KB
testcase_20 AC 113 ms
55,696 KB
testcase_21 AC 118 ms
55,796 KB
testcase_22 AC 116 ms
55,948 KB
testcase_23 AC 119 ms
55,880 KB
testcase_24 AC 120 ms
55,668 KB
testcase_25 AC 119 ms
56,028 KB
testcase_26 AC 117 ms
55,712 KB
testcase_27 AC 116 ms
55,724 KB
testcase_28 AC 117 ms
55,676 KB
testcase_29 AC 118 ms
55,716 KB
testcase_30 AC 120 ms
56,020 KB
testcase_31 AC 120 ms
56,016 KB
testcase_32 AC 116 ms
55,908 KB
testcase_33 AC 119 ms
55,448 KB
testcase_34 AC 116 ms
55,956 KB
testcase_35 AC 119 ms
55,432 KB
testcase_36 AC 120 ms
55,864 KB
testcase_37 AC 116 ms
55,844 KB
testcase_38 AC 117 ms
53,808 KB
testcase_39 AC 116 ms
55,672 KB
testcase_40 AC 119 ms
55,996 KB
testcase_41 AC 118 ms
55,844 KB
testcase_42 AC 113 ms
55,492 KB
testcase_43 AC 114 ms
55,724 KB
testcase_44 AC 120 ms
55,980 KB
testcase_45 AC 121 ms
56,020 KB
testcase_46 AC 117 ms
55,740 KB
testcase_47 AC 116 ms
55,704 KB
testcase_48 AC 117 ms
55,676 KB
testcase_49 AC 117 ms
55,480 KB
testcase_50 AC 120 ms
55,868 KB
testcase_51 AC 121 ms
55,676 KB
testcase_52 AC 117 ms
55,492 KB
testcase_53 AC 117 ms
55,716 KB
testcase_54 AC 117 ms
55,472 KB
testcase_55 AC 119 ms
55,492 KB
testcase_56 AC 120 ms
55,444 KB
testcase_57 AC 117 ms
56,336 KB
testcase_58 AC 117 ms
54,168 KB
testcase_59 AC 118 ms
55,848 KB
testcase_60 AC 119 ms
56,512 KB
testcase_61 AC 118 ms
55,640 KB
testcase_62 AC 117 ms
55,732 KB
testcase_63 AC 112 ms
55,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        if(N==1){
            System.out.println(1);
            return;
        }
        int [] A = new int [N];
        for(int i=0; i<N; i++){
            A[i]=sc.nextInt();
        }
        int x = gcd(A[0],A[1]);
        for(int i=2; i<N; i++){
            x = gcd(x,A[i]);
            if(x==1){break;}
        }
        System.out.println(100/x);
    }
    static int gcd(int a, int b){
        while(true){
            int t = a%b;
            a=b;
            b=t;
            if(t==0){
                break;
            }
        }
        return a;
    }
}
0