結果

問題 No.339 何人が回答したのか
ユーザー spaciaspacia
提出日時 2016-06-08 17:46:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 1,000 ms
コード長 597 bytes
コンパイル時間 1,884 ms
コンパイル使用メモリ 73,912 KB
実行使用メモリ 41,756 KB
最終ジャッジ日時 2024-04-17 09:50:38
合計ジャッジ時間 11,246 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
41,508 KB
testcase_01 AC 133 ms
41,136 KB
testcase_02 AC 129 ms
41,408 KB
testcase_03 AC 126 ms
41,628 KB
testcase_04 AC 132 ms
41,252 KB
testcase_05 AC 121 ms
41,556 KB
testcase_06 AC 123 ms
41,260 KB
testcase_07 AC 123 ms
41,388 KB
testcase_08 AC 120 ms
41,424 KB
testcase_09 AC 121 ms
41,108 KB
testcase_10 AC 123 ms
41,428 KB
testcase_11 AC 123 ms
41,600 KB
testcase_12 AC 112 ms
40,164 KB
testcase_13 AC 123 ms
41,240 KB
testcase_14 AC 103 ms
41,400 KB
testcase_15 AC 110 ms
41,168 KB
testcase_16 AC 112 ms
41,640 KB
testcase_17 AC 116 ms
41,248 KB
testcase_18 AC 119 ms
40,168 KB
testcase_19 AC 116 ms
41,252 KB
testcase_20 AC 109 ms
41,648 KB
testcase_21 AC 116 ms
41,180 KB
testcase_22 AC 100 ms
41,292 KB
testcase_23 AC 105 ms
41,688 KB
testcase_24 AC 116 ms
41,388 KB
testcase_25 AC 122 ms
41,296 KB
testcase_26 AC 111 ms
41,428 KB
testcase_27 AC 116 ms
41,512 KB
testcase_28 AC 117 ms
41,224 KB
testcase_29 AC 110 ms
41,220 KB
testcase_30 AC 122 ms
40,972 KB
testcase_31 AC 117 ms
41,520 KB
testcase_32 AC 109 ms
41,384 KB
testcase_33 AC 120 ms
41,600 KB
testcase_34 AC 125 ms
41,300 KB
testcase_35 AC 125 ms
41,528 KB
testcase_36 AC 125 ms
41,468 KB
testcase_37 AC 111 ms
41,268 KB
testcase_38 AC 109 ms
41,136 KB
testcase_39 AC 127 ms
41,660 KB
testcase_40 AC 117 ms
41,372 KB
testcase_41 AC 104 ms
41,512 KB
testcase_42 AC 126 ms
41,244 KB
testcase_43 AC 130 ms
41,392 KB
testcase_44 AC 137 ms
41,372 KB
testcase_45 AC 125 ms
41,232 KB
testcase_46 AC 120 ms
41,388 KB
testcase_47 AC 124 ms
41,400 KB
testcase_48 AC 121 ms
41,416 KB
testcase_49 AC 108 ms
41,268 KB
testcase_50 AC 119 ms
41,380 KB
testcase_51 AC 124 ms
41,316 KB
testcase_52 AC 116 ms
41,184 KB
testcase_53 AC 105 ms
41,124 KB
testcase_54 AC 117 ms
41,040 KB
testcase_55 AC 106 ms
41,300 KB
testcase_56 AC 118 ms
41,756 KB
testcase_57 AC 121 ms
41,284 KB
testcase_58 AC 122 ms
41,100 KB
testcase_59 AC 127 ms
41,516 KB
testcase_60 AC 109 ms
41,208 KB
testcase_61 AC 121 ms
41,364 KB
testcase_62 AC 122 ms
41,312 KB
testcase_63 AC 121 ms
41,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] nums = new int[n];
		for (int i = 0; i < n; i++)
			nums[i] = sc.nextInt();

		for (int divisor = 100; divisor >= 1; divisor--) {
			boolean flg = true;
			for (int ni = 0; ni < n; ni++) {
				if (nums[ni] % divisor != 0) {
					flg = false;
					break;
				}
			}
			if (flg) {
				int sum = 0;
				for (int ni = 0; ni < n; ni++)
					sum += nums[ni] / divisor;
				System.out.println(sum);
				break;
			}
		}

		sc.close();

	}

}
0