fork download
  1. import numpy as np
  2.  
  3. def good_lad(n):
  4. n, m = n + 1, n + 2
  5. M = np.zeros((n, m), dtype=np.int64)
  6. j = np.arange(1, m) - 1
  7.  
  8. for i in range(1, n):
  9. s = np.cumsum(M[i - j, j])
  10. M[i, 1:] = s
  11. M[i, i + 1:] += 1
  12.  
  13. print('data size in bytes:', M.nbytes)
  14. return M[-1, -1]
  15.  
  16. n = int(input())
  17. print(good_lad(n))
  18.  
Success #stdin #stdout 0.07s 27256KB
stdin
82
stdout
data size in bytes: 55776
92864