結果
| 問題 |
No.2451 Redistribute Integers
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-01 21:41:44 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 925 bytes |
| コンパイル時間 | 3,801 ms |
| コンパイル使用メモリ | 249,508 KB |
| 最終ジャッジ日時 | 2025-02-16 16:25:27 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
struct Fast {
Fast() {
std::cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << setprecision(10);
}
} fast;
#define all(a) (a).begin(), (a).end()
#define contains(a, x) ((a).find(x) != (a).end())
#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (int)(b)-1; i >= (a); i--)
#define writejoin(s, a) rep(_i, 0, (a).size()) cout << (a)[_i] << (_i + 1 < (int)(a).size() ? s : "\n");
#define YN(b) cout << ((b) ? "YES" : "NO") << "\n";
#define Yn(b) cout << ((b) ? "Yes" : "No") << "\n";
#define yn(b) cout << ((b) ? "yes" : "no") << "\n";
using ll = long long;
int main() {
int n;
cin >> n;
bool ans = true;
ll prv = -1;
rep(i, 0, n) {
ll a;
cin >> a;
a %= n;
if (a < 0) a += n;
if (prv > -1) ans &= a == prv;
prv = a;
}
Yn(ans);
}