| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1341562 | kawhiet | Baloni (COCI15_baloni) | C++20 | 42 ms | 464 KiB |
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 1e6 + 5;
bool vis[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int ans = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
if (!vis[x + 1]) {
ans++;
} else {
vis[x + 1] = false;
}
vis[x] = true;
}
cout << ans << '\n';
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
