# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
240837 | bananamaths | Baloni (COCI15_baloni) | C++14 | 290 ms | 7800 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;
cin>>N;
int V[N];
for(int i = 0 ;i<N;i++)
{
cin>>V[i];
}
int H[1000002];
int conta = 0;
for(int i = 1;i<=1000001;i++)
{
H[i] = 0;
}
for(int i = 0;i<N;i++)
{
int a = V[i];
if(H[a+1]>0)
{
H[a+1] -= 1;
H[a] +=1;
}
else
{
conta++;
H[a]++;
}
}
cout<<conta;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |