# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
339208 | ammar2000 | Baloni (COCI15_baloni) | C++17 | 2098 ms | 4916 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 n,co;
int v[100000000];
bool take[100000000];
int main()
{
cin>>n;
//v.resize(n);
for (int i=0;i<n;i++)
cin>>v[i];
for (int i=0;i<n;i++)
{int c=1;
for (int z=i;z>=0;z--)
{
if (v[z]==v[i]+1&&take[z]==0)
{c=0;
take[z]=1;
break;}
}
co+=c;
}
cout <<co;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |