結果
| 問題 | No.2451 Redistribute Integers |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-01 21:34:04 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 235 ms / 2,000 ms |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 1,223 ms |
| コンパイル使用メモリ | 215,500 KB |
| 実行使用メモリ | 28,928 KB |
| 最終ジャッジ日時 | 2026-07-02 08:17:04 |
| 合計ジャッジ時間 | 3,362 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
vector<int> A(N);
long long S = 0;
set<int> st;
for(int i = 0; i < N; i++) {
cin >> A[i];
S += A[i];
st.insert((A[i] % N + N) % N);
}
cout << ((S % N == 0 && (int) st.size() == 1) ? "Yes\n" : "No\n");
return 0;
}