結果
| 問題 | No.1285 ゴミ捨て |
| コンテスト | |
| ユーザー |
Example0911
|
| 提出日時 | 2020-11-13 21:29:07 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 2,000 ms |
| コード長 | 403 bytes |
| 記録 | |
| コンパイル時間 | 2,098 ms |
| コンパイル使用メモリ | 196,644 KB |
| 最終ジャッジ日時 | 2025-01-15 22:35:23 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#include "bits/stdc++.h"
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int N; cin >> N;
vector<int>A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
sort(A.begin(), A.end());
for (int i = 0; i < N - 1; i++) {
if (A[i] == A[i + 1] - 1) {
cout << 2 << endl; return 0;
}
}
cout << 1 << endl;
}
Example0911