結果

問題 No.2451 Redistribute Integers
ユーザー Ashnu BAshnu B
提出日時 2024-02-04 03:59:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 253 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 1,819 ms
コンパイル使用メモリ 172,460 KB
実行使用メモリ 7,200 KB
最終ジャッジ日時 2024-02-04 03:59:47
合計ジャッジ時間 5,413 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 236 ms
7,200 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 170 ms
7,200 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 84 ms
6,676 KB
testcase_13 AC 222 ms
7,200 KB
testcase_14 AC 246 ms
7,200 KB
testcase_15 AC 126 ms
6,676 KB
testcase_16 AC 113 ms
6,676 KB
testcase_17 AC 183 ms
6,676 KB
testcase_18 AC 221 ms
7,200 KB
testcase_19 AC 20 ms
6,676 KB
testcase_20 AC 197 ms
6,676 KB
testcase_21 AC 253 ms
7,084 KB
権限があれば一括ダウンロードができます

ソースコード

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