結果

問題 No.1406 Test
ユーザー sten_san
提出日時 2021-02-26 21:24:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 846 bytes
コンパイル時間 1,734 ms
コンパイル使用メモリ 192,468 KB
最終ジャッジ日時 2025-01-19 04:44:56
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

struct iofast_t {
    iofast_t() {
        ios::sync_with_stdio(false);
        cin.tie(nullptr); cout.tie(nullptr);
    }
} iofast;

struct uns_t {} uns;
template <typename Element, typename Head, typename ...Args>
auto vec(Element init, Head arg, Args ...args) {
    if constexpr (sizeof...(Args) == 0) return std::vector(arg, init);
    else return std::vector(arg, vec(init, args...));
}
template <typename Element, typename Head, typename ...Args>
auto vec(uns_t, Head arg, Args ...args) {
    return vec(Element(), arg, args...);
}

int main() {
    int n; cin >> n;

    int sum = 0;
    for (int i = 1; i < n; ++i) {
        int a; cin >> a;
        sum += a;
    }

    int ans = 0;
    for (int i = 0; i <= 100; ++i) {
        ans += (sum + i) % n == 0;
    }

    cout << ans << endl;
}

0