結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    vector<int> vc;
    for (int i = 0; i < 4; i++) {
        int in;
        cin >> in;
        vc.push_back(in);
    }
    sort(vc.begin(), vc.end());

    for (int i = 0; i < 3; i++) {
        if (vc.at(i) != vc.at(i + 1) - 1) {
            printf("No\n");
            return 0;
        }
    }
    printf("Yes\n");
    return 0;
}
0