You are viewing a single comment's thread. Return to all comments →
Took me 2 minutes to solve it 100/- Python3:
MOD = 10**9 + 7 def calculate_combinations(limit, multiples): lis = [0] * (limit + 1) lis[0] = 1 for i in multiples: for n in range(limit - i + 1): lis[n + i] += lis[n] lis[n + i] %= MOD return lis no = 10**5 multiples = [1, 2, 5, 10, 20, 50, 100, 200] lis = calculate_combinations(no, multiples) for _ in range(int(input())): n = int(input()) print(lis[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 →
Took me 2 minutes to solve it 100/- Python3: