# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
280128 | 3zp | Baloni (COCI15_baloni) | C++14 | 140 ms | 3984 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 f[1000009];
main(){
int n;
int ans = 0;
scanf("%d", &n);
for(int i = 1; i <= n; i++){
int h;
scanf("%d", &h);
if(f[h+1]) f[h+1]--, f[h]++;
else ans++, f[h]++;
}
cout << ans << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |