結果

問題 No.406 鴨等間隔の法則
ユーザー mine691
提出日時 2019-03-27 19:53:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 501 bytes
コンパイル時間 1,917 ms
コンパイル使用メモリ 171,336 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 02:25:27
合計ジャッジ時間 3,607 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

int n;

int main()
{
    cin >> n;
    vector<int> a;
    for (int i = 0; i < n; i++)
    {
        int p;
        cin >> p;
        a.push_back(p);
    }
    bool f = 1;
    sort(a.begin(), a.end());
    for (int i = 1; i < n; i++)
    {
        if (a[i - 1] + 6 != a[i])
            f = false;
    }

    cout << (f ? "YES" : "NO") << endl;
}
0