# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
66631 | 2018-08-11T19:52:59 Z | zetapi | Dancing Elephants (IOI11_elephants) | C++14 | 0 ms | 0 KB |
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); } }