結果

問題 No.998 Four Integers
ユーザー wightou
提出日時 2025-06-27 05:29:39
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 661 bytes
コンパイル時間 3,292 ms
コンパイル使用メモリ 281,580 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-27 05:29:44
合計ジャッジ時間 4,401 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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

/////////////////// メイン ///////////////////

int main () {
  
  //////////////////// 入力 ////////////////////

  int n;
  // cin >> n;
  n = 4;

  vector<int> a(n);
  for (int i=0; i<n; i++) {
    cin >> a.at(i);
  }

  //////////////// 出力変数定義 ////////////////

  string result = "Yes";

  //////////////////// 処理 ////////////////////

  sort(a.begin(),a.end());

  for (int i=0; i<n-1; i++) {
    if (a.at(i)+1!=a.at(i+1)) result = "No";
  }

  //////////////////// 出力 ////////////////////

  cout << result << endl;

  //////////////////// 終了 ////////////////////

  return 0;

}
0