結果

問題 No.998 Four Integers
ユーザー test
提出日時 2020-09-12 05:33:19
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 445 bytes
コンパイル時間 1,981 ms
コンパイル使用メモリ 196,664 KB
最終ジャッジ日時 2025-01-14 13:07:54
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, ss, ee) for (int i = ss; i < ee; ++i)
using namespace std;

bool isFunc(vector<int> &v) {
  sort(v.begin(), v.end());
  rep(i, 0, 3) if (v[i + 1] - v[i] != 1) return false;
  return true;
}

void solve() {
  int N = 4;
  vector<int> v(N);
  rep(i, 0, N) { cin >> v[i]; }
  cout << ((isFunc(v)) ? "Yes" : "No") << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  getchar();
}
0