結果

問題 No.2451 Redistribute Integers
ユーザー t98slidert98slider
提出日時 2023-09-01 22:00:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 1,848 ms
コンパイル使用メモリ 169,588 KB
実行使用メモリ 5,440 KB
最終ジャッジ日時 2023-09-01 22:00:46
合計ジャッジ時間 4,028 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 71 ms
4,836 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 55 ms
5,312 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 35 ms
4,376 KB
testcase_13 AC 81 ms
4,880 KB
testcase_14 AC 89 ms
4,828 KB
testcase_15 AC 46 ms
4,376 KB
testcase_16 AC 46 ms
4,380 KB
testcase_17 AC 75 ms
4,896 KB
testcase_18 AC 77 ms
4,956 KB
testcase_19 AC 9 ms
4,380 KB
testcase_20 AC 81 ms
4,932 KB
testcase_21 AC 100 ms
5,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, v;
    cin >> n;
    vector<int> a(n);
    for(auto &&v : a) cin >> v;
    sort(a.begin(), a.end());
    for(int i = 0; i < n; i++){
        if((a[i] - a[0]) % n != 0){
            cout << "No\n";
            exit(0);
        }
    }
    cout << "Yes\n";
}
0