You are viewing a single comment's thread. Return to all comments →
import numpy as np
def map_func(y): return map(int, y.split())
def sum_prod(x): N, M = map_func(x) array = (np.array([list(map_func(input())) for _ in range(N)])) print(np.prod(np.sum(array, axis = 0)))
sample_input = input() sum_prod(sample_input)
Seems like cookies are disabled on this browser, please enable them to open this website
Sum and Prod
You are viewing a single comment's thread. Return to all comments →
Enter your code here. Read input from STDIN. Print output to STDOUT
import numpy as np
def map_func(y): return map(int, y.split())
def sum_prod(x): N, M = map_func(x) array = (np.array([list(map_func(input())) for _ in range(N)])) print(np.prod(np.sum(array, axis = 0)))
sample_input = input() sum_prod(sample_input)