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.
n=int(input())
record=[]
if(2<=n<=5):
for i in range (n):
name=input()
score=float(input())
record.append([name,score])
s=[]
for j in range(len(record)):
s.append(record[j][1])
s.sort()
a=[]
for i in range(len(record)):
if(s[1]>s[0]):
if(record[i][1]==s[1]):
a.append(record[i][0])
elif(s[1]==s[0] and s[1]!=s[2]):
if(record[i][1]==s[2]):
a.append(record[i][0])
elif(s[0]==s[1]):
if(s[1]==s[2]):
if(record[i][1]==s[3]):
a.append(record[i][0])
a.sort()
for k in a:
print(k)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
n=int(input()) record=[] if(2<=n<=5): for i in range (n): name=input() score=float(input()) record.append([name,score])