# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1184945 | InvMOD | Baloni (COCI15_baloni) | C++17 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int mp[N];
int main(){
int n; cin >> n;
vector<int> a(n, 0);
for(int i = 0; i < n; i++){
cin >> a[i];
}
int cnt = 0;
for(int i = 0; i < n; i++){
if(!mp[h[i]]){
mp[h[i]]++;
cnt++;
}
else{
mp[h[i]]--;
mp[h[i] - 1]++;
}
}
cout << cnt << "\n";
return 0;
}