結果
問題 | No.1285 ゴミ捨て |
ユーザー |
![]() |
提出日時 | 2020-11-13 21:22:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 56 ms / 2,000 ms |
コード長 | 342 bytes |
コンパイル時間 | 2,212 ms |
コンパイル使用メモリ | 196,980 KB |
最終ジャッジ日時 | 2025-01-15 22:27:18 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000005 int main(){ int N; cin>>N; vector<int> A(N); rep(i,N)cin>>A[i]; sort(A.begin(),A.end()); rep(i,N-1){ if(A[i]+1>=A[i+1]){ cout<<2<<endl; return 0; } } cout<<1<<endl; return 0; }