結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) noexcept {
  return std::vector<T>(n, std::forward<T>(val));
}

template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) noexcept {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}

int main() {
  vector<i64> v(4);
  rep(i,0,4) cin >> v[i];
  sort(all(v));
  bool OK = true;
  rep(i,1,4) {
    if(v[i] == v[0] + i) {

    }
    else {
      OK = false;
    }
  }
  if(OK) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}
0