# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
590010 | 0123xx | Baloni (COCI15_baloni) | C++14 | 67 ms | 3700 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n, ar[1000005], freq[1000005], ans;
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
for (int i = 1; i<= n; i++){
cin >> ar[i];
if (freq[ar[i]+1] == 0){
freq[ar[i]+1]--;
}
else{
ans++;
}
freq[ar[i]]++;
}
cout << ans << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |