myaw's blog

By myaw, history, 4 years ago, In English,

I was trying to solve K-Tree 431C But i'am getting WA in protest 5 , the input is 0 , this is my 12482418 any helps ??

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

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by d4rk-h4ck3r (previous revision, new revision, compare).

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

You forgot about mod and I used long long dp[2002][202];

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

and add

if(sum == n && ok == 0){

return dp[sum][ok] = 0;

}

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This :

    if (sum == tot) return ok;
    if (sum > n) return 0;


should be like this:

    if (sum == tot) return ok;
    if (sum > tot) return 0;
  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    thank you , what a silly mistake get AC .