結果

問題 No.339 何人が回答したのか
ユーザー Grenache
提出日時 2016-02-15 21:13:56
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 476 bytes
コンパイル時間 3,297 ms
コンパイル使用メモリ 74,540 KB
実行使用メモリ 54,756 KB
最終ジャッジ日時 2024-09-22 07:10:46
合計ジャッジ時間 13,424 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder339 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int gcd = 100;
        for (int i = 0; i < n; i++) {
        	gcd = gcd(gcd, sc.nextInt());
        }

        System.out.println(100 / gcd);

        sc.close();
    }

	private static int gcd(int n, int m) {
		if (m == 0) {
			return n;
		} else {
			return gcd(m, n % m);
		}
	}
}
0