結果

問題 No.998 Four Integers
ユーザー CroweaCrowea
提出日時 2020-04-28 21:40:14
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,508 bytes
コンパイル時間 1,779 ms
コンパイル使用メモリ 203,608 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-16 19:15:21
合計ジャッジ時間 3,578 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#pragma region TEMPLATE
constexpr auto INF = 1000000000000;   //10^12;;
constexpr auto MOD = 1000000007;      //10^9+7;;
constexpr auto EPS = 1e-9;
constexpr auto PI  = 3.141592653589793238462643383279;

#define endl '\n';
#define ALL(v) v.begin(), v.end() 
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(v) sort(ALL(v)) 
#define RSORT(v) sort(RALL(v))
#define SZ(x) ((int)(x).size())
#define FOR(i, j, k) for (int i=j ; i<k ; i++)
#define RFOR(i, j, k) for (int i=j ; i>=k ; i--)
#define REP(i, j) FOR(i, 0, j)
#define RREP(i, j) RFOR(i, j, 0)
#define FOREACH(it,l) for (auto it = l.begin(); it != l.end(); it++)

using ll = long long;
template<class T = int> T in() { T x; cin >> x; return x; }
template<class T> void out(T value) { cout << value << endl; }
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

#pragma endregion

struct Fast_IO {
    const int prec = 10;
    Fast_IO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(prec);
    }
} fast_io;

using  VI = vector<int>;
signed main() {
    Fast_IO();
    
    VI v(4); REP(i, 4) v[i] = in();
    SORT(v);
    
    bool flag = true;
    FOR(i, 1, 4) {
        if (v[i] != v[i - 1] + 1) {
            flag = false;
            break;
        }
    }
    out(flag ? "Yes" : "No");

    return 0;
}
0