結果

問題 No.339 何人が回答したのか
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-16 21:20:57
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 646 bytes
コンパイル時間 2,020 ms
コンパイル使用メモリ 71,448 KB
実行使用メモリ 56,344 KB
最終ジャッジ日時 2023-08-17 07:33:21
合計ジャッジ時間 12,621 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
55,736 KB
testcase_01 AC 131 ms
55,508 KB
testcase_02 AC 126 ms
55,936 KB
testcase_03 AC 126 ms
55,756 KB
testcase_04 AC 125 ms
55,504 KB
testcase_05 AC 125 ms
55,708 KB
testcase_06 AC 126 ms
55,488 KB
testcase_07 AC 127 ms
55,824 KB
testcase_08 AC 126 ms
55,484 KB
testcase_09 AC 127 ms
56,064 KB
testcase_10 AC 127 ms
55,904 KB
testcase_11 AC 126 ms
55,912 KB
testcase_12 AC 127 ms
56,112 KB
testcase_13 AC 128 ms
56,016 KB
testcase_14 AC 126 ms
55,756 KB
testcase_15 AC 126 ms
56,092 KB
testcase_16 AC 128 ms
55,488 KB
testcase_17 AC 127 ms
55,816 KB
testcase_18 AC 126 ms
55,820 KB
testcase_19 AC 125 ms
55,908 KB
testcase_20 AC 128 ms
55,980 KB
testcase_21 AC 126 ms
55,492 KB
testcase_22 AC 131 ms
55,760 KB
testcase_23 AC 129 ms
55,880 KB
testcase_24 AC 127 ms
55,824 KB
testcase_25 AC 126 ms
53,764 KB
testcase_26 AC 126 ms
55,984 KB
testcase_27 AC 126 ms
55,724 KB
testcase_28 AC 124 ms
55,692 KB
testcase_29 AC 125 ms
55,708 KB
testcase_30 AC 124 ms
55,724 KB
testcase_31 AC 126 ms
56,000 KB
testcase_32 AC 127 ms
55,780 KB
testcase_33 AC 129 ms
55,564 KB
testcase_34 AC 128 ms
55,732 KB
testcase_35 AC 126 ms
55,940 KB
testcase_36 AC 126 ms
55,936 KB
testcase_37 AC 125 ms
55,944 KB
testcase_38 AC 126 ms
55,504 KB
testcase_39 AC 127 ms
55,844 KB
testcase_40 AC 126 ms
55,976 KB
testcase_41 AC 125 ms
56,068 KB
testcase_42 AC 127 ms
56,344 KB
testcase_43 AC 125 ms
55,896 KB
testcase_44 AC 126 ms
55,872 KB
testcase_45 AC 127 ms
55,720 KB
testcase_46 AC 128 ms
55,500 KB
testcase_47 AC 126 ms
55,936 KB
testcase_48 AC 126 ms
55,940 KB
testcase_49 AC 125 ms
55,916 KB
testcase_50 AC 125 ms
55,800 KB
testcase_51 AC 127 ms
56,148 KB
testcase_52 AC 127 ms
55,956 KB
testcase_53 AC 128 ms
55,900 KB
testcase_54 AC 127 ms
55,872 KB
testcase_55 AC 125 ms
55,912 KB
testcase_56 AC 127 ms
55,668 KB
testcase_57 AC 128 ms
55,984 KB
testcase_58 AC 128 ms
55,488 KB
testcase_59 AC 126 ms
55,604 KB
testcase_60 AC 127 ms
55,740 KB
testcase_61 RE -
testcase_62 AC 125 ms
55,692 KB
testcase_63 AC 124 ms
55,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N =sc.nextInt();
        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