# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1042248 | biserailieva | Baloni (COCI15_baloni) | C++14 | 33 ms | 4052 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 mxh=1000005;
int cnt[mxh];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin>>n;
int res=0;
for(int i=0;i<n;i++)
{
int x;
cin>>x;
if(cnt[x]==0)
{
res++;
}
else
{
cnt[x]--;
}
cnt[x-1]++;
}
cout<<res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |