結果

問題 No.2451 Redistribute Integers
ユーザー AerenAeren
提出日時 2023-09-01 21:25:30
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 878 bytes
コンパイル時間 5,465 ms
コンパイル使用メモリ 356,708 KB
実行使用メモリ 4,884 KB
最終ジャッジ日時 2023-09-01 21:25:39
合計ジャッジ時間 5,927 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 65 ms
4,836 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 47 ms
4,840 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 22 ms
4,380 KB
testcase_13 AC 60 ms
4,828 KB
testcase_14 AC 63 ms
4,796 KB
testcase_15 AC 33 ms
4,376 KB
testcase_16 AC 29 ms
4,380 KB
testcase_17 AC 45 ms
4,376 KB
testcase_18 AC 59 ms
4,792 KB
testcase_19 AC 6 ms
4,376 KB
testcase_20 AC 49 ms
4,528 KB
testcase_21 AC 61 ms
4,884 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 + n) % n != (a[0] % n + n) % n){
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
	return 0;
}

/*

*/

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