結果
| 問題 |
No.2451 Redistribute Integers
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2023-09-01 21:30:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 221 ms / 2,000 ms |
| コード長 | 539 bytes |
| コンパイル時間 | 3,267 ms |
| コンパイル使用メモリ | 230,624 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 10:59:50 |
| 合計ジャッジ時間 | 6,362 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/all>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvl;
typedef pair<int,int> P;
typedef long double ld;
int main(){
int n;
cin >> n;
vi a(n);
rep(i, n) cin >> a[i];
sort(a.begin(), a.end());
string ans = "Yes";
rep(i, n - 1){
if((a[i + 1] - a[i]) % n != 0) ans = "No";
}
cout << ans << "\n";
return 0;
}