結果

問題 No.2451 Redistribute Integers
ユーザー AerenAeren
提出日時 2023-09-01 21:24:10
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 937 bytes
コンパイル時間 3,323 ms
コンパイル使用メモリ 357,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 10:57:34
合計ジャッジ時間 4,882 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 WA -
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 64 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 44 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 21 ms
5,376 KB
testcase_13 AC 61 ms
5,376 KB
testcase_14 AC 60 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 27 ms
5,376 KB
testcase_17 AC 43 ms
5,376 KB
testcase_18 AC 56 ms
5,376 KB
testcase_19 AC 6 ms
5,376 KB
testcase_20 AC 47 ms
5,376 KB
testcase_21 AC 61 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <x86intrin.h>
using namespace std;
using namespace numbers;



int main(){
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(ios::badbit | ios::failbit);
	int n;
	cin >> n;
	vector<int> a(n);
	copy_n(istream_iterator<int>(cin), n, a.begin());
	for(auto i = 1; i < n; ++ i){
		if(a[i] % n != a[0] % n){
			cout << "No\n";
			return 0;
		}
	}
	if(accumulate(a.begin(), a.end(), 0LL) % n){
		cout << "No\n";
		return 0;
	}
	cout << "Yes\n";
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////
0