結果

問題 No.339 何人が回答したのか
コンテスト
ユーザー Grenache
提出日時 2016-02-15 21:13:56
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 476 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,544 ms
コンパイル使用メモリ 82,652 KB
実行使用メモリ 41,948 KB
最終ジャッジ日時 2026-04-10 12:59:53
合計ジャッジ時間 8,404 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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