We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# Enter your code here. Read input from STDIN. Print output to STDOUTk,m=map(int,input().split(" "))li=[]foriinrange(1,k+1):li.append((max(list(map(int,input().split()))))**2)print(sum(li)%m)
What I did here is I took the max element out of all k lists provided, summed up the square value of the element(s) and as said applied modular with m.
Am I missing something? Please explain if I misunderstood the problem. Thx.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximize It!
You are viewing a single comment's thread. Return to all comments →
Did I misunderstood the problem??
What I did here is I took the max element out of all k lists provided, summed up the square value of the element(s) and as said applied modular with m. Am I missing something? Please explain if I misunderstood the problem. Thx.