# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156130 | mdn2002 | Baloni (COCI15_baloni) | C++14 | 343 ms | 3840 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;
long long mod=1e9+7;
int n,a[1000006],num[1000006],ans;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
if(num[a[i]+1]>0)
{
num[a[i]+1]--;
}
else ans++;
num[a[i]]++;
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |