結果

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

ソースコード

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);
  int cnt=0;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      if(A[i]+1<A[j]){
        cnt++;
        break;
      }
    }
  }
  
  cout<<n-cnt<<endl;
  return 0;
}

  
0