結果

問題 No.998 Four Integers
ユーザー hanachanX
提出日時 2020-04-12 11:08:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,008 bytes
コンパイル時間 2,264 ms
コンパイル使用メモリ 180,004 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-22 02:17:29
合計ジャッジ時間 3,218 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
#define repr(i ,n) for(int i=n;i>(int)(n);--i)
#define rep1(i ,n) for(int i=1;i<=(int)(n);++i)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define PRINT(x) printf("%d\n",(x));
using namespace std;
typedef long long int int64;
typedef unsigned long long uint64;
template<class T> using V = vector<T>;
using I = int;
using VI = V<I>;
const int INF = 2e9;
const int64 MOD = 1e9 + 7;

template <class T> inline bool chmin(T& a, T b){if(a>b){a=b; return true;} return false;}
template <class T> inline bool chmax(T& a, T b){if(a<b){a=b; return true;} return false;}

int main(){
    int a , b , c , d; cin >> a >> b >> c >> d;
    int array[]={a , b , c , d};
    sort(array , array+4);
    if(array[0]+1==array[1]&&array[1]+1==array[2]&&array[2]+1==array[3])
        cout << "Yes" << endl;
        else cout << "No" << endl;
}
0