fork(5) download
  1. from functools import lru_cache
  2.  
  3. @lru_cache()
  4. def yoba(s, n):
  5. if n == 1:
  6. return s < 10
  7. return sum(yoba(s - i, n - 1) for i in range(10))
  8.  
  9. print(yoba(73, 9))
Success #stdin #stdout 0.06s 10320KB
stdin
Standard input is empty
stdout
12870