結果

問題 No.2451 Redistribute Integers
ユーザー MARTHMARTH
提出日時 2023-09-01 21:32:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 739 bytes
コンパイル時間 2,595 ms
コンパイル使用メモリ 197,656 KB
実行使用メモリ 7,428 KB
最終ジャッジ日時 2023-09-01 21:32:16
合計ジャッジ時間 5,807 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 217 ms
7,300 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 156 ms
7,224 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 68 ms
4,740 KB
testcase_13 AC 185 ms
7,336 KB
testcase_14 AC 208 ms
7,272 KB
testcase_15 AC 103 ms
5,328 KB
testcase_16 AC 93 ms
5,056 KB
testcase_17 AC 151 ms
6,184 KB
testcase_18 AC 192 ms
7,428 KB
testcase_19 AC 16 ms
4,380 KB
testcase_20 AC 159 ms
6,376 KB
testcase_21 AC 201 ms
7,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> pii;
#include <atcoder/convolution>
#include <atcoder/modint>
//using mint = atcoder::modint1000000007;
using mint = atcoder::modint998244353;
//.val()でintとして出力 llに注意
ll INF=1e15;
ll modpow(ll a,ll x,ll M){//a^x modM
              ll r=1;
              for (; x>0; x>>=1,a=a*a%M) if (x&1) r=r*a%M;
             return r;
}

int N;
ll A[500009];
string ans="Yes";

int main(){
	cin >> N;
	rep(i,N){
		cin >> A[i];
	}
	rrep(i,1,N-1){
		if(abs(A[1]-A[i])%(N)!=0) ans="No";
	}
	cout << ans << endl;
}
0