Блог пользователя sguu

Автор sguu, история, 6 лет назад, По-английски

Here is problem:http://acm.timus.ru/problem.aspx?space=1&num=1658

for which test case my solution is wrong:https://ideone.com/AKSZX6??

i did dp[0][0]=1 which is different from AC solution

No one in this world to help.

If no one gonna help i will loose My faith in humanity :( onwards

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

The dp calculates number of digits in the answer and when you reach (0,0) state you use all the digits so it must return 0 because after this computation stops. Also remove equal sign from check condition to get minimum number.

Solution = https://pastebin.com/36qf9Sfh