sguu's blog

By sguu, history, 6 years ago, In English

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

  • Vote: I like it
  • -9
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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