# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
292359 | MilosMilutinovic | Baloni (COCI15_baloni) | C++14 | 303 ms | 4088 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 main(){
int n;
scanf("%i",&n);
int a[n];
for(int i=0;i<n;i++)scanf("%i",&a[i]);
int ans=0;
map<int,int> mp;
for(int i=0;i<n;i++){
if(!mp[a[i]+1])ans++;
else mp[a[i]+1]--;
mp[a[i]]++;
}
printf("%i",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |