結果

問題 No.1406 Test
ユーザー ks2mks2m
提出日時 2021-02-26 22:57:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 2,486 ms
コンパイル使用メモリ 74,760 KB
実行使用メモリ 54,272 KB
最終ジャッジ日時 2024-04-10 13:37:31
合計ジャッジ時間 5,950 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
54,272 KB
testcase_01 AC 110 ms
53,748 KB
testcase_02 AC 108 ms
54,000 KB
testcase_03 AC 105 ms
53,904 KB
testcase_04 AC 107 ms
53,884 KB
testcase_05 AC 95 ms
52,488 KB
testcase_06 AC 109 ms
54,052 KB
testcase_07 AC 107 ms
54,008 KB
testcase_08 AC 108 ms
54,040 KB
testcase_09 AC 107 ms
54,028 KB
testcase_10 AC 99 ms
54,232 KB
testcase_11 AC 111 ms
54,056 KB
testcase_12 AC 106 ms
53,508 KB
testcase_13 AC 109 ms
54,100 KB
testcase_14 AC 108 ms
54,140 KB
testcase_15 AC 108 ms
54,108 KB
testcase_16 AC 107 ms
53,996 KB
testcase_17 AC 108 ms
54,008 KB
testcase_18 AC 102 ms
52,764 KB
testcase_19 AC 107 ms
54,120 KB
testcase_20 AC 113 ms
54,060 KB
testcase_21 AC 109 ms
54,140 KB
testcase_22 AC 109 ms
54,260 KB
testcase_23 AC 107 ms
54,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n - 1];
		for (int i = 0; i < n - 1; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();

		int sum = 0;
		for (int i = 0; i < a.length; i++) {
			sum += a[i];
		}

		int ans = 0;
		for (int i = 0; i <= 100; i++) {
			if ((sum + i) % n == 0) {
				ans++;
			}
		}
		System.out.println(ans);
	}
}
0