結果

問題 No.998 Four Integers
ユーザー Hasegawa_frog
提出日時 2020-02-28 21:25:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 581 bytes
コンパイル時間 1,663 ms
コンパイル使用メモリ 170,960 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 23:02:26
合計ジャッジ時間 2,521 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef long long ll;
typedef pair<int, int> P;

#define mod 1000000007
#define inf 1000000000
#define all(x) (x).begin(), (x).end()
#define pb push_back

const long double PI = acos(-1);

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}

int main(){
  vector<ll> n(4);
  for(ll i = 0; i < 4; i++) cin >> n[i];
  sort(all(n));

  bool ok = true;
  for(ll i = 0; i < 3; i++){
    if(n[i]+1 != n[i+1]){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
0