제출 #1341561

#제출 시각아이디문제언어결과실행 시간메모리
1341561kawhietBaloni (COCI15_baloni)C++20
0 / 100
37 ms444 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++;
        }
        vis[x] = 1;
    }
    cout << ans << '\n';
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...