Created
April 17, 2017 10:33
-
-
Save DeviaVir/1cc22dd9177565f7313f73e4fb00df79 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C = raw_input() | |
M = raw_input() | |
C1 = int(C.split(' ')[0]) | |
C2 = int(C.split(' ')[1]) | |
ways = [1]+[0] * C1 | |
for coin in M.split(' ')[:C2]: | |
coin = int(coin) | |
for i in range(coin, C1+1): | |
ways[i] += ways[i - coin] | |
print(ways[C1]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment