Submission #1332816

#TimeUsernameProblemLanguageResultExecution timeMemory
1332816Zone_zoneeBaloni (COCI15_baloni)C++20
100 / 100
41 ms448 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6+10;

int a[N];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int ans = 0;
    for(int i = 1, x; i <= n; ++i){
        cin >> x;
        a[x]++;
        if(a[x+1]) a[x+1]--;
        else ans++;
    }
    cout << ans << '\n';
}
#Verdict Execution timeMemoryGrader output
Fetching results...