# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163865 | beso123 | Baloni (COCI15_baloni) | C++14 | 338 ms | 10888 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>
#define int long long
using namespace std;
int n,a[1000001],used[1000001];
main(){
scanf("%i64d",&n);
for(int k=1;k<=n;k++)
scanf("%I64d",&a[k]);
int ans=0;
ans++;
used[a[1]]++;
for(int k=2;k<=n;k++){
if(used[a[k]+1]==0)
ans++;
else used[a[k]+1]--;
used[a[k]]++;
}
cout<<ans;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |