brucewayne123's blog

By brucewayne123, history, 8 years ago, In English

http://codeforces.com/problemset/problem/543/A hello! i was trying doing this problem in a top down manner.. but i am not able to calculate all the distinct ways.. for example.. if we have v1=1,v2=2,v3-0 then we can add 6 ways to answer by rearranging them but my code adds this just once.. also i am not getting why my recursion is going wrong.. please help me with it.. here is my implementaion without memoising.. https://ideone.com/rUtBD7 i have read the editorial which is explained nicely but it would be nice if someone corrects me in my top down approach.. thanks..

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

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

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