結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    const int n = 4;
    vector<int> a(n);
    for (auto &e : a) cin >> e;
    sort(a.begin(), a.end());
    
    bool ans = true;
    for (int i = 0; i+1 < n; i++) ans &= (a[i] + 1 == a[i+1]);
    cout << (ans ? "Yes" : "No") << endl;
    return 0;
}
0