結果

問題 No.2451 Redistribute Integers
ユーザー PAKACHUPAKACHU
提出日時 2023-09-01 21:32:47
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 660 bytes
コンパイル時間 8,198 ms
コンパイル使用メモリ 134,796 KB
実行使用メモリ 7,172 KB
最終ジャッジ日時 2023-09-01 21:33:03
合計ジャッジ時間 9,425 ms
ジャッジサーバーID
(参考情報)
judge16 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 235 ms
7,108 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 221 ms
7,164 KB
testcase_14 AC 245 ms
7,172 KB
testcase_15 AC 123 ms
5,268 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 218 ms
7,108 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
int dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, 1, 0, -1, 1, -1, 1, -1 };
const long long mod = 998244353;
const ll inf = 1LL << 60;
const int INF = 5e8;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];

    sort(a.begin(), a.end());
    vector<int> b;
    for (int i = 0; i < n - 1; i++) {
        b.push_back(a[i + 1] - a[i]);
    }

    for (auto i : b) {
        if (i % n) {
            cout << "No" << endl;
        }
    }

    cout << "Yes" << endl;
}
0