結果

問題 No.339 何人が回答したのか
ユーザー Mcpu3
提出日時 2018-09-09 19:15:03
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 516 bytes
コンパイル時間 2,223 ms
コンパイル使用メモリ 74,396 KB
実行使用メモリ 41,816 KB
最終ジャッジ日時 2024-12-23 23:54:03
合計ジャッジ時間 11,029 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
    public static int gcd(int x,int y){
        int r;
        while(y>0){
            r=x%y;
            x=y;
            y=r;
        }
        return x;
    }

    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt(),a[]=new int[n];
        for(int i=0;i<n;++i)a[i]=sc.nextInt();
        sc.close();
        for(int i=1;i<n;++i)a[i]=gcd(a[i-1],a[i]);
        System.out.print(100/a[n-1]);
    }
}
0