Skip to content

Instantly share code, notes, and snippets.

@tthtlc
Created June 28, 2021 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tthtlc/7c3ded5ade015f3719a078c100c8fef8 to your computer and use it in GitHub Desktop.
Save tthtlc/7c3ded5ade015f3719a078c100c8fef8 to your computer and use it in GitHub Desktop.
Project Euler problem 31
count=0
for onep in range(201):
for twop in range(101):
for fivep in range(41):
for tenp in range(21):
for twentyp in range(11):
for fiftyp in range(5):
for apound in range(2):
for twopound in range(2):
sum=onep+twop*2+fivep*5+tenp*10+twentyp*20+fiftyp*50+apound*100+twopound*200
if (sum==200):
count += 1
print(onep, twop, fivep, tenp, twentyp, fiftyp, apound, twopound, count)
print("total ways", count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment