結果

問題 No.339 何人が回答したのか
ユーザー 37zigen37zigen
提出日時 2016-04-11 19:55:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 1,000 ms
コード長 587 bytes
コンパイル時間 2,135 ms
コンパイル使用メモリ 74,996 KB
実行使用メモリ 55,944 KB
最終ジャッジ日時 2024-04-15 00:18:53
合計ジャッジ時間 12,171 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
54,032 KB
testcase_01 AC 137 ms
53,856 KB
testcase_02 AC 133 ms
54,144 KB
testcase_03 AC 132 ms
54,220 KB
testcase_04 AC 132 ms
54,276 KB
testcase_05 AC 131 ms
53,800 KB
testcase_06 AC 131 ms
54,008 KB
testcase_07 AC 130 ms
54,088 KB
testcase_08 AC 130 ms
53,988 KB
testcase_09 AC 132 ms
54,112 KB
testcase_10 AC 133 ms
54,048 KB
testcase_11 AC 137 ms
53,964 KB
testcase_12 AC 134 ms
54,132 KB
testcase_13 AC 134 ms
54,208 KB
testcase_14 AC 132 ms
54,104 KB
testcase_15 AC 132 ms
54,204 KB
testcase_16 AC 130 ms
54,172 KB
testcase_17 AC 134 ms
54,296 KB
testcase_18 AC 131 ms
54,088 KB
testcase_19 AC 131 ms
53,800 KB
testcase_20 AC 121 ms
53,024 KB
testcase_21 AC 131 ms
53,848 KB
testcase_22 AC 131 ms
54,084 KB
testcase_23 AC 129 ms
53,848 KB
testcase_24 AC 130 ms
54,308 KB
testcase_25 AC 131 ms
53,880 KB
testcase_26 AC 132 ms
53,864 KB
testcase_27 AC 131 ms
54,108 KB
testcase_28 AC 131 ms
53,996 KB
testcase_29 AC 134 ms
53,984 KB
testcase_30 AC 131 ms
54,252 KB
testcase_31 AC 132 ms
54,016 KB
testcase_32 AC 132 ms
54,112 KB
testcase_33 AC 132 ms
54,080 KB
testcase_34 AC 130 ms
54,192 KB
testcase_35 AC 131 ms
53,956 KB
testcase_36 AC 118 ms
52,756 KB
testcase_37 AC 130 ms
53,884 KB
testcase_38 AC 131 ms
54,008 KB
testcase_39 AC 131 ms
55,944 KB
testcase_40 AC 132 ms
54,056 KB
testcase_41 AC 131 ms
53,856 KB
testcase_42 AC 131 ms
54,084 KB
testcase_43 AC 131 ms
54,168 KB
testcase_44 AC 129 ms
54,088 KB
testcase_45 AC 132 ms
53,900 KB
testcase_46 AC 132 ms
53,876 KB
testcase_47 AC 130 ms
53,956 KB
testcase_48 AC 132 ms
54,328 KB
testcase_49 AC 133 ms
54,184 KB
testcase_50 AC 133 ms
54,088 KB
testcase_51 AC 134 ms
54,212 KB
testcase_52 AC 131 ms
53,880 KB
testcase_53 AC 134 ms
54,020 KB
testcase_54 AC 132 ms
54,264 KB
testcase_55 AC 132 ms
54,120 KB
testcase_56 AC 132 ms
53,960 KB
testcase_57 AC 117 ms
52,992 KB
testcase_58 AC 134 ms
54,000 KB
testcase_59 AC 131 ms
53,884 KB
testcase_60 AC 129 ms
54,248 KB
testcase_61 AC 131 ms
53,960 KB
testcase_62 AC 119 ms
52,756 KB
testcase_63 AC 131 ms
53,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.*;
public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		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();
		}
		int gcd=1;
		for(int i=0;i<n;i++){
			if(i==0)gcd=a[i];
			else gcd=GCD(a[i],gcd);
		}
		System.out.println(100/gcd);
	}
	int GCD(int a,int b){
		if(a<b){
			int d=a;
			a=b;
			b=d;
		}
		if(b==0)return a;
		return GCD(b,a%b);
	}
	void tr(Object...o){System.out.println(Arrays.deepToString(o));}
}
0