結果

問題 No.2451 Redistribute Integers
ユーザー Ashnu BAshnu B
提出日時 2024-02-04 03:59:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 1,501 ms
コンパイル使用メモリ 171,592 KB
実行使用メモリ 7,296 KB
最終ジャッジ日時 2024-06-11 11:09:08
合計ジャッジ時間 4,432 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n;
	cin>>n;
	vector<long long>a(n);
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a.begin(),a.end());
	int f=1;
	for(int i=0;i<n-1;i++) if((a[i+1]-a[i])%n!=0) f=0;
	if(f==0) cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
}
0