結果

問題 No.339 何人が回答したのか
ユーザー atkrym
提出日時 2016-10-19 17:01:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 549 bytes
コンパイル時間 2,325 ms
コンパイル使用メモリ 74,172 KB
実行使用メモリ 41,472 KB
最終ジャッジ日時 2024-11-22 16:44:23
合計ジャッジ時間 11,987 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

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