結果
問題 | No.2451 Redistribute Integers |
ユーザー | Narikiti0926 |
提出日時 | 2023-09-03 00:21:10 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,043 bytes |
コンパイル時間 | 4,095 ms |
コンパイル使用メモリ | 232,160 KB |
実行使用メモリ | 21,520 KB |
最終ジャッジ日時 | 2023-09-03 00:21:21 |
合計ジャッジ時間 | 10,381 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 221 ms
7,036 KB |
testcase_05 | AC | 1 ms
4,376 KB |
testcase_06 | AC | 1 ms
4,380 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 256 ms
18,648 KB |
testcase_09 | AC | 2 ms
4,384 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 118 ms
9,404 KB |
testcase_13 | AC | 193 ms
7,096 KB |
testcase_14 | AC | 211 ms
7,020 KB |
testcase_15 | WA | - |
testcase_16 | AC | 179 ms
11,264 KB |
testcase_17 | AC | 346 ms
16,624 KB |
testcase_18 | AC | 196 ms
7,032 KB |
testcase_19 | AC | 24 ms
4,556 KB |
testcase_20 | AC | 406 ms
17,532 KB |
testcase_21 | AC | 521 ms
21,520 KB |
コンパイルメッセージ
main.cpp: 関数 ‘void in(T& ...)’ 内: main.cpp:37:55: 警告: fold-expressions only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 37 | template<class... T> void in(T&... a){ (cin >> ... >> a); } | ^ main.cpp: 関数 ‘void out(const T&, const Ts& ...)’ 内: main.cpp:39:112: 警告: fold-expressions only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 39 | template<class T, class... Ts> void out(const T& a, const Ts&... b){ cout << a; (cout << ... << (cout << ' ', b)); cout << '\n'; } | ^
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define overload4(_1, _2, _3, _4, name, ...) name #define rep1(n) for(int i = 0; i < (int)(n); ++i) #define rep2(i, n) for(int i = 0; i < (int)(n); ++i) #define rep3(i, a, b) for(int i = (a); i < (int)(b); ++i) #define rep4(i, a, b, c) for(int i = (a); i < (int)(b); i += (c)) #define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define Sort(a) sort(a.begin(), a.end()) #define RSort(a) sort(a.rbegin(), a.rend()) typedef long long int ll; typedef unsigned long long ull; typedef long double ld; typedef vector<int> vi; typedef vector<char> vcr; typedef vector<long long> vll; typedef vector<long double> vld; typedef vector<string> vst; const ll INF = 0x1fffffffffffffff; const ll MOD = 998244353; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p){ is >> p.first >> p.second; return is; } template<typename T> istream &operator>>(istream &is, vector<T> &v){ for(T &in : v) is >> in; return is; } template<typename T> ostream &operator<<(ostream &os, const vector<T> &v){ for(int i = 0; i < (int) v.size(); ++i){ os << v[i] << (i + 1 != (int) v.size() ? " " : ""); } return os; } template<class... T> void in(T&... a){ (cin >> ... >> a); } void out(){ cout << '\n'; } template<class T, class... Ts> void out(const T& a, const Ts&... b){ cout << a; (cout << ... << (cout << ' ', b)); cout << '\n'; } // 素数を判定する関数 bool isprime(int N) { if (N < 2) return false; for (int i = 2; i * i <= N; ++i) { if (N % i == 0) return false; } return true; } int main() { ll n; in(n); vll a(n); in(a); set<ll> t; rep(i,n){ t.insert(abs(a[i]) % n); } if(t.size() == 1){ out("Yes"); }else{ out("No"); } }