Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RockPaperScissorsMagicEasy:
- def count(self, card, score):
- dp_arr = [ [0]*(score+1) for i in range(len(card)+1) ]
- for i in range(1,len(card)+1):
- dp_arr[i][0] = 2**i
- if(score>=1):
- dp_arr[1][1] = 1
- for i in range(2,score+1):
- dp_arr[1][i] = 0
- for i in range(2,len(card)+1):
- for j in range(1,score+1):
- dp_arr[i][j] = dp_arr[i-1][j-1] + dp_arr[i-1][j]*2
- dp_arr[i][j] %= 1000000007
- return dp_arr[len(card)][score]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement