結果

問題 No.406 鴨等間隔の法則
ユーザー NagisaNagisa
提出日時 2016-08-16 09:16:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 1,899 ms
コンパイル使用メモリ 167,664 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 20:28:14
合計ジャッジ時間 3,709 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 2 ms
5,248 KB
testcase_03 AC 2 ms
5,248 KB
testcase_04 AC 43 ms
5,376 KB
testcase_05 AC 17 ms
5,376 KB
testcase_06 AC 18 ms
5,376 KB
testcase_07 AC 19 ms
5,376 KB
testcase_08 AC 43 ms
5,376 KB
testcase_09 AC 46 ms
5,376 KB
testcase_10 AC 20 ms
5,376 KB
testcase_11 AC 36 ms
5,376 KB
testcase_12 AC 25 ms
5,376 KB
testcase_13 AC 23 ms
5,376 KB
testcase_14 WA -
testcase_15 AC 4 ms
5,376 KB
testcase_16 AC 5 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 5 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 7 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 26 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 46 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 40 ms
5,376 KB
testcase_28 AC 41 ms
5,376 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 44 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> x(N+1);
    REP(i,N) cin >> x[i];
    sort(x.begin(),x.end());
    int d = x[1]-x[0];
    for(int i = 1; i < N; i++){
        if(x[i]-x[i-1] != d || x[i]-x[i-1] == 0){
            cout << "NO" << endl;
            exit(0);
        }
    }
    cout << "YES" << endl;
    return 0;
}
0