# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40955 | IvanC | Baloni (COCI15_baloni) | C++14 | 131 ms | 604 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;
const int MAXN = 1e6 + 10;
int freq[MAXN],N,ans;
int main(){
scanf("%d",&N);
for(int i = 1;i<=N;i++){
int x;
scanf("%d",&x);
if(freq[x]){
freq[x]--;
freq[x-1]++;
}
else{
ans++;
freq[x-1]++;
}
}
printf("%d\n",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |