結果
問題 |
No.1285 ゴミ捨て
|
ユーザー |
|
提出日時 | 2021-09-12 13:53:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 322 bytes |
コンパイル時間 | 3,871 ms |
コンパイル使用メモリ | 230,700 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 02:51:04 |
合計ジャッジ時間 | 8,462 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 WA * 10 |
ソースコード
#define _GLIBCXX_DEBUG #define ll long long #include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> S(N); for(int i = 0; i < N; i++) cin >> S[i]; sort(S.begin(), S.end()); int ans = 1; for(int i = 0; i+1 < N; i++){ if(S[i]+1 == S[i+1]) ans++; } cout << ans << endl; }