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