結果

問題 No.1406 Test
ユーザー tentententen
提出日時 2021-02-26 21:26:36
言語 Java19
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 2,002 ms
コンパイル使用メモリ 71,360 KB
実行使用メモリ 56,160 KB
最終ジャッジ日時 2023-07-25 20:21:48
合計ジャッジ時間 6,380 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,836 KB
testcase_01 AC 124 ms
55,772 KB
testcase_02 AC 125 ms
55,352 KB
testcase_03 AC 127 ms
55,572 KB
testcase_04 AC 125 ms
55,788 KB
testcase_05 AC 125 ms
55,780 KB
testcase_06 AC 127 ms
56,024 KB
testcase_07 AC 125 ms
56,044 KB
testcase_08 AC 128 ms
55,912 KB
testcase_09 AC 128 ms
55,552 KB
testcase_10 AC 128 ms
55,556 KB
testcase_11 AC 124 ms
56,160 KB
testcase_12 AC 127 ms
55,684 KB
testcase_13 AC 125 ms
55,780 KB
testcase_14 AC 124 ms
55,756 KB
testcase_15 AC 125 ms
56,052 KB
testcase_16 AC 129 ms
55,560 KB
testcase_17 AC 126 ms
55,420 KB
testcase_18 AC 125 ms
55,492 KB
testcase_19 AC 126 ms
55,868 KB
testcase_20 AC 123 ms
55,676 KB
testcase_21 AC 125 ms
55,732 KB
testcase_22 AC 125 ms
55,528 KB
testcase_23 AC 125 ms
55,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < n - 1; i++) {
            sum += sc.nextInt();
        }
        int ans = 0;
        for (int i = 0; i <= 100; i++) {
            if ((sum + i) % n == 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
    
}
0