fork(2) download
  1. Numbers = [10, 2, 3, 1]
  2. Maximum = 13
  3. Array = [0 for i in xrange(0, Maximum + 1)]
  4. Array[0] = 1
  5. for CurrentNum in Numbers:
  6. for Num in xrange(Maximum - CurrentNum, -1, -1):
  7. if (Array[Num]):
  8. Array[Num + CurrentNum] += 1
  9.  
  10. print Array[Maximum]
Success #stdin #stdout 0.01s 23304KB
stdin
Standard input is empty
stdout
2