結果
| 問題 |
No.1285 ゴミ捨て
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-13 21:25:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 463 bytes |
| コンパイル時間 | 1,594 ms |
| コンパイル使用メモリ | 168,884 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-22 20:26:25 |
| 合計ジャッジ時間 | 2,698 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 WA * 12 |
ソースコード
#include <bits/stdc++.h>
#define ll long long
#define rep(i,x,n) for(ll i=x;i<n;i++)
#define rrep(i,x,n) for(ll i=x;i>=n;i--)
using namespace std;
ll mod=1000000007;
void solve(){
int n;
cin>>n;
int a[n];
rep(i,0,n) cin>>a[i];
sort(a,a+n);
int st=a[n-1];
int ans=1;
rrep(i,n-2,0){
if(a[i]+1>=st) st=a[i],ans++;
}
cout<<min(ans,2)<<endl;
}
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
solve();
}