結果

問題 No.339 何人が回答したのか
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-05-30 23:14:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 1,000 ms
コード長 551 bytes
コンパイル時間 3,879 ms
コンパイル使用メモリ 72,984 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2023-09-12 20:52:23
合計ジャッジ時間 15,746 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
56,112 KB
testcase_01 AC 132 ms
55,612 KB
testcase_02 AC 127 ms
55,664 KB
testcase_03 AC 126 ms
55,972 KB
testcase_04 AC 126 ms
55,784 KB
testcase_05 AC 126 ms
55,776 KB
testcase_06 AC 128 ms
56,080 KB
testcase_07 AC 126 ms
55,748 KB
testcase_08 AC 125 ms
55,852 KB
testcase_09 AC 126 ms
55,704 KB
testcase_10 AC 128 ms
56,024 KB
testcase_11 AC 128 ms
55,780 KB
testcase_12 AC 126 ms
55,624 KB
testcase_13 AC 127 ms
55,732 KB
testcase_14 AC 127 ms
55,512 KB
testcase_15 AC 129 ms
55,808 KB
testcase_16 AC 128 ms
55,516 KB
testcase_17 AC 128 ms
55,800 KB
testcase_18 AC 126 ms
55,872 KB
testcase_19 AC 126 ms
55,852 KB
testcase_20 AC 126 ms
55,956 KB
testcase_21 AC 127 ms
55,808 KB
testcase_22 AC 128 ms
56,064 KB
testcase_23 AC 127 ms
55,676 KB
testcase_24 AC 127 ms
56,144 KB
testcase_25 AC 127 ms
55,700 KB
testcase_26 AC 127 ms
56,008 KB
testcase_27 AC 127 ms
55,760 KB
testcase_28 AC 128 ms
56,012 KB
testcase_29 AC 129 ms
56,164 KB
testcase_30 AC 128 ms
55,956 KB
testcase_31 AC 129 ms
55,736 KB
testcase_32 AC 126 ms
55,480 KB
testcase_33 AC 127 ms
55,712 KB
testcase_34 AC 127 ms
56,120 KB
testcase_35 AC 127 ms
56,028 KB
testcase_36 AC 126 ms
55,796 KB
testcase_37 AC 128 ms
55,548 KB
testcase_38 AC 125 ms
55,948 KB
testcase_39 AC 127 ms
56,056 KB
testcase_40 AC 127 ms
55,484 KB
testcase_41 AC 128 ms
56,024 KB
testcase_42 AC 130 ms
56,020 KB
testcase_43 AC 128 ms
55,520 KB
testcase_44 AC 129 ms
55,756 KB
testcase_45 AC 128 ms
56,072 KB
testcase_46 AC 128 ms
55,716 KB
testcase_47 AC 130 ms
53,908 KB
testcase_48 AC 129 ms
55,516 KB
testcase_49 AC 127 ms
55,636 KB
testcase_50 AC 127 ms
55,824 KB
testcase_51 AC 128 ms
55,864 KB
testcase_52 AC 126 ms
55,792 KB
testcase_53 AC 129 ms
55,772 KB
testcase_54 AC 127 ms
55,552 KB
testcase_55 AC 127 ms
56,068 KB
testcase_56 AC 128 ms
55,928 KB
testcase_57 AC 127 ms
55,756 KB
testcase_58 AC 130 ms
56,104 KB
testcase_59 AC 130 ms
55,480 KB
testcase_60 AC 127 ms
55,520 KB
testcase_61 AC 127 ms
55,888 KB
testcase_62 AC 125 ms
55,992 KB
testcase_63 AC 127 ms
55,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		Arrays.sort(A);
		int min_A = A[0];
		int gcd = 100;
		for(int i = 1; i < N; i++){
			int gcd_tmp = get_gcd(min_A, A[i]);
			if(gcd_tmp < gcd) gcd = gcd_tmp;
		}
		System.out.println(100/gcd);
	}
	private static int get_gcd(int x, int y){
		int tmp;
		while((tmp  = x%y) != 0){
			x = y;
			y = tmp;
		}
		return y;
	}
}
0