結果
問題 | No.2451 Redistribute Integers |
ユーザー |
|
提出日時 | 2023-09-01 21:49:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 235 ms / 2,000 ms |
コード長 | 312 bytes |
コンパイル時間 | 1,759 ms |
コンパイル使用メモリ | 198,388 KB |
最終ジャッジ日時 | 2025-02-16 16:29:33 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) int main(){ int n; cin>>n; vector<int> a(n); rep(i,n) cin>>a.at(i); sort(a.begin(),a.end()); rep(i,n-1){ if((a.at(i+1)-a.at(i))%n!=0){ cout<<"No\n"; return 0; } } cout<<"Yes\n"; }