You are viewing a single comment's thread. Return to all comments →
MOD = 10**9 + 7 coins = [1, 2, 5, 10, 20, 50, 100, 200] ways = [0] * 100001 ways[0] = 1 for coin in coins: for i in range(coin, 100001): ways[i] += ways[i - coin] t = int(input()) for _ in range(t): n = int(input()) print(ways[n] % MOD)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #31: Coin sums
You are viewing a single comment's thread. Return to all comments →