結果

問題 No.998 Four Integers
ユーザー 0Kate
提出日時 2020-04-12 00:16:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 390 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 68,908 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 18:01:14
合計ジャッジ時間 1,315 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    int nums[4];
    for (int i = 0; i < 4; i++)
        cin >> nums[i];

    sort(nums, nums+4);

    bool ok = true;
    for (int i = 0; i < 3; i++) {
        if (nums[i + 1] - nums[i] != 1) {
            ok = false;
            break;
        }
    }

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

    return 0;
}
0