Sum and Prod

Sort by

recency

|

348 Discussions

|

  • + 0 comments
    import numpy as np
    n, m = map(int, input().split())
    
    a = np.array([list(map(int, input().split())) for _ in range(n)])
    
    arr_sum = list(np.sum(a, axis = 0))
    result = np.prod(arr_sum)
    print(result)
    
  • + 0 comments

    Simple code from my side..

    import numpy
    
    a , b = map(int,input().split())
    
    arrayList = []
    for i in range(a):
        arrayList.append(list(map(int,input().split())))
    
    print(numpy.prod(numpy.sum(arrayList, axis = 0) ))
    
  • + 0 comments

    import numpy as np

    N,M = list(map(int, input().split())) ll=[] for i in range(N): arr=np.array(list(map(int, input().split()))) ll.append(arr) a3=np.sum(ll, axis = 0) print(np.prod(a3))

  • + 0 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)

  • + 0 comments
    import numpy as np
    N,M = map(int,input().split())
    print(np.prod(np.sum(np.array([list(map(int,input().split())) for _ in range(N)]),axis=0)))