I saw your code and then I looked at the problem on Code Forces. You seem to implement a tableau of integers in dp. The answer needed seems to be the number of bills. There is the commentary section for bills inferior to 100. Then I don’t try to understand what’s in the for loop. Faithfully, SC