結果
問題 | No.1406 Test |
ユーザー | Sooh317 |
提出日時 | 2021-02-26 21:29:39 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 2,040 bytes |
コンパイル時間 | 2,094 ms |
コンパイル使用メモリ | 199,944 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-07-25 20:25:20 |
合計ジャッジ時間 | 3,103 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,376 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,376 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 2 ms
4,380 KB |
testcase_09 | AC | 1 ms
4,380 KB |
testcase_10 | AC | 2 ms
4,380 KB |
testcase_11 | AC | 1 ms
4,376 KB |
testcase_12 | AC | 2 ms
4,380 KB |
testcase_13 | AC | 1 ms
4,380 KB |
testcase_14 | AC | 2 ms
4,380 KB |
testcase_15 | AC | 2 ms
4,380 KB |
testcase_16 | AC | 2 ms
4,380 KB |
testcase_17 | AC | 2 ms
4,380 KB |
testcase_18 | AC | 1 ms
4,380 KB |
testcase_19 | AC | 1 ms
4,376 KB |
testcase_20 | AC | 2 ms
4,380 KB |
testcase_21 | AC | 2 ms
4,376 KB |
testcase_22 | AC | 1 ms
4,380 KB |
testcase_23 | AC | 1 ms
4,380 KB |
ソースコード
#include<bits/stdc++.h> using namespace std; #pragma region atcoder //#include <atcoder/modint> //using namespace atcoder; //using mint = modint998244353; //using mint = modint1000000007; #pragma endregion #pragma region debug for var, v, vv #define debug(var) do{std::cerr << #var << " : ";view(var);}while(0) template<typename T> void view(T e){std::cerr << e << std::endl;} template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cerr << e << " "; } std::cerr << std::endl;} template<typename T> void view(const std::vector<std::vector<T> >& vv){cerr << endl;int cnt = 0;for(const auto& v : vv){cerr << cnt << "th : "; view(v); cnt++;} cerr << endl;} #pragma endregion using ll = long long; const ll mod = 1000000007; const int inf = 1001001001; const ll INF = 1001001001001001001ll; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; template<class T, class K>bool chmax(T &a, const K b) { if (a<b) { a=b; return 1; } return 0; } template<class T, class K>bool chmin(T &a, const K b) { if (b<a) { a=b; return 1; } return 0; } ll rudiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); } // 20 / 3 == 7 ll rddiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); } // -20 / 3 == -7 ll power(ll a, ll p){ll ret = 1; while(p){if(p & 1){ret = ret * a;} a = a * a; p >>= 1;} return ret;} ll modpow(ll a, ll p, ll m){ll ret = 1; while(p){if(p & 1){ret = ret * a % m;} a = a * a % m; p >>= 1;} return ret;} /*---------------------------------------------------------------------------------------------------------------------------------*/ int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); //cout << fixed << setprecision(20); int n; cin >> n; vector<int> a(n - 1); for(int i = 0; i < n - 1; i++) cin >> a[i]; int sum = accumulate(a.begin(), a.end(), 0); int ans = 0; for(int i = 0; i <= 100; i++){ if((sum + i) % n == 0) ans++; } cout << ans << endl; } /* * review your code when you get WA (typo? index?) * int overflow, array bounds * special cases (n=1?) */