結果
| 問題 |
No.1285 ゴミ捨て
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-10 12:48:39 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 352 bytes |
| コンパイル時間 | 1,765 ms |
| コンパイル使用メモリ | 170,844 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 20:29:58 |
| 合計ジャッジ時間 | 3,822 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>
int main() {
int N;
cin >> N;
vector<int> a(N);
rep(i, N) cin >> a[i];
sort(a.begin(), a.end());
int ans = 1;
rep(i, N-1) {
if (a[i] + 1 >= a[i+1]) ans++;
}
cout << ans << endl;
}