結果
| 問題 | No.1285 ゴミ捨て |
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2021-02-08 18:35:20 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 435 bytes |
| 記録 | |
| コンパイル時間 | 583 ms |
| コンパイル使用メモリ | 93,816 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-03-27 05:44:38 |
| 合計ジャッジ時間 | 2,598 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 WA * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(){
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
sort(a.begin() , a.end());
a.push_back(-1);
int ans = 0;
for(int i = 0; i < n; i++){
if(a[i] + 1 < a[i + 1])continue;
ans += 1;
}
cout << ans << endl;
return 0;
}
mmn15277198