# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
66631 | zetapi | Dancing Elephants (IOI11_elephants) | C++14 | 0 ms | 0 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.
ll count(ll CurrentBlock,ll CoveredTill)
{
if(CurrentBlock>=blocks.size())
return 0;
if(CoveredTill>=arr[blocks[CurrentBlock].second])
return count(CurrentBlock+1,CoveredTill);
for(int A=1;Index[CurrentBlock][A]>0;A=nxt[A])
if(arr[Index[CurrentBlock][A]]<=CoveredTill)
continue;
else
{
CoveredTill=arr[Index[CurrentBlock][A]]+dp[Index[CurrentBlock][A]]*K;
return dp[Index[CurrentBlock][A]]+count(CurrentBlock+1,CoveredTill);
}
}