# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154268 | radugheo | Baloni (COCI15_baloni) | C++14 | 354 ms | 7392 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 <iostream>
using namespace std;
int n, i, sol, v[1000005], f[1000005];
int main(){
cin >> n;
for (i=1; i<=n; i++){
cin >> v[i];
}
for (i=1; i<=n; i++){
if (f[v[i]+1]){
f[v[i]+1]--;
}
else{
sol++;
}
f[v[i]]++;
}
cout << sol;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |