[submission:78417751]I have formed the recursive solution for the problem Heaters https://codeforces.net/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://codeforces.net/contest/1066/submission/78417751
Thanks in advance!