You are viewing a single comment's thread. Return to all comments →
following code shows terminated due to timeout!!! plzz help i didnt understand what I'am doing wrong.
t = int(input().strip()) m = [] n = [] cost = [] index = [] flag = 0 for i in range(t): m.append(int(input().strip())) n.append(int(input().strip())) cost.append([int(i) for i in input().split()]) for i in range(t): flag = 0 for k in range(n[i]): for l in range(n[i]): if cost[i][k] + cost[i][l] == m[i] and k!=l and flag==0: index.append([k+1,l+1]) flag = 1 for item in index: print(*item, sep=' ')
Seems like cookies are disabled on this browser, please enable them to open this website
Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
following code shows terminated due to timeout!!! plzz help i didnt understand what I'am doing wrong.