fork download
  1. f = lambda x:sum(r[i]*r[~i]for i,r in enumerate(x))
  2.  
  3. print f([[-1, 1], [-2, 1]])
  4. print f([[824, -65], [-814, -741]])
  5. print f([[-1, -8, 4], [4, 0, -5], [-3, 5, 2]])
  6. print f([[0, -1, 0], [1, 0, 2], [1, 0, 1]])
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
-3
549614
-10
1