Yath's blog

By Yath, history, 21 month(s) ago, In English

The answer is coming 0 instead of some positive value for some test cases Submission: https://codeforces.com/contest/1703/submission/164043486

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
21 month(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

Typecast pow into long long .it might work.

»
21 month(s) ago, # |
Rev. 3   Vote: I like it +2 Vote: I do not like it
Spoiler
  • »
    »
    21 month(s) ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you!!! This worked and also I get it why it is not enough to take dp[n][i] while calculating the final answer.

    • »
      »
      »
      21 month(s) ago, # ^ |
      Rev. 2   Vote: I like it +1 Vote: I do not like it
      Spoiler