fork download
  1. from itertools import *
  2. r = 200
  3. p = [1,2,5,10,20,50,100,200]
  4. n = 0
  5. def t(s,pc):
  6. if pc>=len(p):
  7. return
  8. for i in count(0):
  9. l = s+i*p[pc]
  10. if l == r:
  11. global n
  12. n+=1
  13. if l >= r:
  14. return
  15. t(l,pc+1)
  16. t(0,0)
  17. print n
Time limit exceeded #stdin #stdout 5s 6396KB
stdin
Standard input is empty
stdout
Standard output is empty