結果

問題 No.998 Four Integers
ユーザー isolated
提出日時 2020-04-09 00:53:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 656 bytes
コンパイル時間 1,659 ms
コンパイル使用メモリ 171,596 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 05:57:35
合計ジャッジ時間 2,131 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
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(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> a;
    rep(i,4){
        int t;cin>>t;
        a.push_back(t);
    }
    sort(all(a));
    string ans = "Yes";
    for(int i=1;i<=3;i++){
        if(a[i]-a[i-1] != 1) ans ="No";
    }
    cout<<ans<<endl;
}
0