We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
no=10**5multiples=[1,2,5,10,20,50,100,200,]lis=[]foriinrange(no+1):lis.append(i//2+1)#it reduced my time efficiency by 3 times in my earlier code which was slowerforiinmultiples[2:]:forninrange(no-i+1):lis[n+i]+=lis[n]for_inrange(int(input())):n=int(input())print(lis[n]%(10**9+7))
Cookie support is required to access HackerRank
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 →
Lovely challenge, 100/- points python3