結果

問題 No.1285 ゴミ捨て
ユーザー chacoder1
提出日時 2020-11-23 11:57:17
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 273 bytes
コンパイル時間 4,101 ms
コンパイル使用メモリ 195,044 KB
最終ジャッジ日時 2025-01-16 05:01:28
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
  int n;
  cin>>n;
  int A[n];
  for(int i=0;i<n;i++) cin>>A[i];
  sort(A,A+n);
  for(int i=0;i<n-1;i++){
    if(A[i+1]<=A[i]+1){
      cout<<2<<endl;
      return 0;
    }
  }
  
  cout<<1<<endl;
  return 0;
}

  
0