[submission:78417751]I have formed the recursive solution for the problem Heaters https://mirror.codeforces.com/contest/1066/problem/B. In order to optimise the solution I am trying to use memoization approach but stuck in defining the state for dp.
My solution — https://mirror.codeforces.com/contest/1066/submission/78417751
Thanks in advance!