fork(1) download
  1. # your code goes here
  2.  
  3. def getsol(N,A,Sol):
  4. if Sol[N]!=-1:
  5. return Sol[N]
  6. if N==0:
  7. return 1
  8. ans=0
  9. for i in A:
  10. ans=ans+getsol(N,A,Sol)
  11. Sol(N)=ans
  12. return Sol(N)
  13. N=10
  14. A=[2,5,3,6]
  15. Sol=[-1]*11
  16. i=10
  17. print getsol(N,A,Sol)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/py_compile.py", line 117, in compile
    raise py_exc
py_compile.PyCompileError:   File "prog.py", line 11
    Sol(N)=ans
SyntaxError: can't assign to function call

stdout
Standard output is empty