結果

問題 No.998 Four Integers
ユーザー merom686
提出日時 2020-02-28 21:21:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 470 bytes
コンパイル時間 1,007 ms
コンパイル使用メモリ 78,576 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 22:56:31
合計ジャッジ時間 1,591 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    int n = 4;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());

    int b = 1;
    for (int i = 1; i < n; i++) {
        if (a[i - 1] + 1 != a[i]) b = 0;
    }

    cout << (b ? "Yes" : "No") << endl;

    return 0;
}
0