結果

問題 No.339 何人が回答したのか
ユーザー uafr_csuafr_cs
提出日時 2016-02-02 22:00:56
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 1,000 ms
コード長 562 bytes
コンパイル時間 1,837 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 41,572 KB
最終ジャッジ日時 2024-09-21 20:05:47
合計ジャッジ時間 11,660 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static int gcd(int a, int b){
		return b == 0 ? a : gcd(b, a % b);
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] array = new int[N];
		for(int i = 0; i < N; i++){
			array[i] = sc.nextInt();
		}
		
		int gcd = array[0];
		for(int i = 1; i < N; i++){
			gcd = gcd(gcd, array[i]);
		}
		
		System.out.println(100 / gcd);
	}

}
0