TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
list = []
for i in range(N):
    input_list = input()
    S = input_list.split(" ")[0]
    P = int(input_list.split(" ")[1])
    list.append([i, S, P])

#from operator import itemgetter

list.sort(key=lambda x: x[2] ,reverse=True)
list.sort(key=lambda x: x[1])
for i in range(N):
    list[i].append(i)
list.sort()
for i in range(N):
    print(list[i][3]+1)


N = int(input())
list = []
for i in range(N):
    input_list = input()
    S = input_list.split(" ")[0]
    P = int(input_list.split(" ")[1])
    list.append([i, S, P])

#from operator import itemgetter

list.sort(key=lambda x: x[2] ,reverse=True)
list.sort(key=lambda x: x[1])
for i in range(N):
    print(list[i][0]+1)


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
sp = []

for i in range(n):
    sp.append(input().split())
    sp[i].append(i + 1)

sp.sort(key=lambda x:(x[0], -int(x[1])))
print(sp)
for r in sp:
    print(r[2])


n = int(input())
sp = []

for i in range(n):
    sp.append(input().split())
    sp[i].append(i + 1)

sp.sort(key=lambda x:(x[0], -int(x[1])))
# print(sp)
for r in sp:
    print(r[2])


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
sList, pList = [], []
for i in range(n):
    s, p = map(str, input().split())
    sList.append(s)
    pList.append(p)

sListSet = sorted(set(sList))
pListSet = sorted(set(pList), reverse=True)

print(sListSet, pListSet)

spList = []
for i in range(n):
    spList.append(sListSet.index(sList[i]) * 1000 + pListSet.index(pList[i]))

print(spList, sorted(spList))

for i in range(n):
    print(spList.index(sorted(spList)[i]) + 1)


n = int(input())
spList = [input().split() for _ in range(n)]
for i in range(n):
    spList[i][1] = 100 - int(spList[i][1])

spResultList = sorted(spList)
for i in range(n):
    print(spList.index(spResultList[i]) + 1)


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
import sys
args = sys.stdin.readlines()
N = int(args[0])
d = {}
for i, line in enumerate(args[1:]):
  S, p = line.split(' ')
  P = int(p)
  if S in d:
    d[S].append((i+1, P))
  else:
    d[S] = []
    d[S].append((i+1, P))
    
for key in d.keys():
    d[key].sort(key=lambda x:x[1], reverse=True)
    for (i, p) in d[key]:
        print(i)

import sys
args = sys.stdin.readlines()
N = int(args[0])
d = {}
for i, line in enumerate(args[1:]):
  S, p = line.split(' ')
  P = int(p)
  if S in d:
    d[S].append((i+1, P))
  else:
    d[S] = []
    d[S].append((i+1, P))
    
for key in sorted(d.keys()):
    d[key].sort(key=lambda x:x[1], reverse=True)
    for (i, p) in d[key]:
        print(i)


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
rest_list = []
for i in range(N):
    a,b=input().split()
    temp=[i+1,a,(-1)*int(b)]
    rest_list.append(temp)
print(rest_list)
rest_list.sort(key=lambda x: (x[1], x[2]))
for i in rest_list:
    print(i[0])


N = int(input())
rest_list = []
for i in range(N):
    a,b=input().split()
    temp=[i+1,a,(-1)*int(b)]
    rest_list.append(temp)
rest_list.sort(key=lambda x: (x[1], x[2]))
for i in rest_list:
    print(i[0])


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n=int(input())
List=[[input().split() , i+1] for i in range(n)]

List=sorted(List,key=lambda x : (x[0],-int(x[1])))

for i in range(n):
    print(List[i][2])

n=int(input())
List=[[input().split() , i+1] for i in range(n)]

List=sorted(List,key=lambda x : (x[0][0],-int(x[0][1])))

for i in range(n):
    print(List[i][1])

Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n=int(input())
s=[]

for i in range(n):
  a,b=map(str,input().split())
  s.append([a,b,i+1])
  
#s.sort(key=lambda x:(x[0],x[1]))
print(s)

for i in range(n):
  print(s[i][2])

n=int(input())
s=[]

for i in range(n):
  a,b=map(str,input().split())
  b=int(b)
  s.append([a,100-b,i+1])
  
s.sort(key=lambda x:(x[0],x[1]))
#print(s)

for i in range(n):
  print(s[i][2])

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())

news = []

for i in range(N):
  hoge = input().split()
  news.append((str(hoge[0]),int(hoge[1])))
  
huga = sorted(range(len(news)), key=lambda k: news[k])
for i in range(len(huga)):
  print(huga[i])

N = int(input())

news = []

for i in range(N):
  hoge = input().split()
  news.append((str(hoge[0]),int(hoge[1])))

print(sorted(news))
huga = sorted(news)

for i in range(N):
  for j in range(N):
    if huga[i] ==news[j]:
      print(j)

N = int(input())

news = []

for i in range(N):
  hoge = input().split()
  news.append((str(hoge[0]),int(hoge[1])))
  
print(sorted(range(len(news)), key=lambda k: news[k]))

from operator import itemgetter

N = int(input())

news = []

for i in range(N):
  hoge = input().split()
  news.append((str(hoge[0]),int(hoge[1])))

b = sorted(news, key=itemgetter(1), reverse=True)
c = sorted(b, key=itemgetter(0))
print(c)

for i in range(N):
  for j in range(N):
    if c[i] ==news[j]:
      print(j+1)


from operator import itemgetter

N = int(input())

news = []

for i in range(N):
  hoge = input().split()
  news.append((str(hoge[0]),int(hoge[1])))

b = sorted(news, key=itemgetter(1), reverse=True)
c = sorted(b, key=itemgetter(0))

for i in range(N):
  for j in range(N):
    if c[i] ==news[j]:
      print(j+1)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
lst = []
for i in range(n):
  s, p = input().split()
  p = int(p)
  lst.append((s, p, i+1))
lst_sorted = sorted(lst, key:lambda x: (x[0], -x[1], x[2]))
for _, _, num in lst_sorted:
  print(num)


n = int(input())
lst = []
for i in range(n):
  s, p = input().split()
  p = int(p)
  lst.append((s, p, i+1))
lst_sorted = sorted(lst, key:lambda x: (x[0], -x[1]))
for _, _, num in lst_sorted:
  print(num)

n = int(input())
lst = []
for i in range(n):
  s, p = input().split()
  p = int(p)
  lst.append((s, p, i+1))
lst_sorted = sorted(lst, key=lambda x: (x[0], -x[1], x[2]))
for _, _, num in lst_sorted:
  print(num)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N=int(input())
l=[]
for i in range(N):
  s,p=input(i).split()
  l.append((s,-int(p),i+1))

list=sorted(l,key=lambda x:(x[0],x[1]))
for i in list:
  print(l[2])


N=int(input())
l=[]
for i in range(N):
  s,p=input().split(" ")
  l.append((s,-int(p),i+1))
 
l2=sorted(l,key=lambda x:(x[0],x[1]))
for l in l2:
  print(l[2])

Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N=int(input())
rest=[]
for i in range(1,N+1):
    s,p=input().split()
    p=int(p)
    rest.append((s,-p,i))



for i in range(N):
    print(x[i][2])
    

    


N=int(input())
rest=[]
for i in range(1,N+1):
    s,p=input().split()
    p=int(p)
    rest.append((s,-p,i))


print(x)
for i in range(N):
    print(x[i][2])
    

    


N=int(input())
rest=[]
for i in range(1,N+1):
    s,p=input().split()
    p=int(p)
    rest.append((s,-p,i))

x=sorted(rest)


for i in range(N):
    print(x[i][2])
    

    


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
S = []
P = []
for i in range(N):
    s,p = input().split()
    S.append(s)
    P.append(int(p))
Sset = sorted(list(set(S)))

dict1 = {}
for i in range(N):
    dict1[P[i]] = S[i]

print(Sset)

for k in Sset:
    U = [i for i, j in dict1.items() if j == k]
    V = sorted(U,reverse=True)
    for l in V:
        print(P.index(l) + 1)

N = int(input())
S = []
P = []
for i in range(N):
    s,p = input().split()
    S.append(s)
    P.append(int(p))
Sset = sorted(list(set(S)))

dict1 = {}
for i in range(N):
    dict1[P[i]] = S[i]

for k in Sset:
    U = [i for i, j in dict1.items() if j == k]
    V = sorted(U,reverse=True)
    for l in V:
        print(P.index(l) + 1)

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N=int(input())
A=[]

for i in range(N):
    s,p=map(str,input().split())
    p=int(p)
    A.append([s,p,i+1])

A.sort()
i=0
j=1
print(A)

while i<N-1:
    if j>N-1:
        break
    if A[i][0]==A[i+1][0]:
        j=i+1
        if j<N:
            while A[i][0]==A[j][0]:
                j+=1
                if j>=N:
                    break
    A[i:j]=sorted(A[i:j],key=lambda x:x[1],reverse=True)
    i=j

for i in range(N):
    print(A[i][2])

N=int(input())
A=[]

for i in range(N):
    s,p=map(str,input().split())
    p=-1*int(p)
    A.append([s,p,i+1])

A.sort()

for i in range(N):
    print(A[i][2])

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
ls = []
for i in range(1,n+1):
  s,p = input().split()
  ls.append([i,s,int(p)])
ls.sort(key=lambda x:(x[1], x[2]))
for j in range(len(ls)):
  print(ls[j][0])


n = iint(input())
ls = []
for i in range(1,n+1):
  s,p = input().split()
  ls.append([i,s,int(p)])
ls.sort(key=lambda x:(x[1], x[2]))
for j in range(len(ls)):
  print(ls[j][0])

n = int(input())
ls = []
for i  in range(1,n+1):
    s,p = input().split()
    ls.append([i, s, int(p)])
    
ans = sorted(ls, key=lambda x: (x[1], -x[2]))
for j in range(n):
    print(ans[j][0])

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
res_list = []
for i in range(n):
    a,b=input().split()
    res_list.append((a,int(b)))
psorted_res_list = sorted(res_list, key=lambda x: x[1], reverse=True)
sorted_res_list = sorted(psorted_res_list, key=lambda x: x[0])
for i in range(n):
    print(sorted_res_list.index(res_list[i]) + 1)

n = int(input())
res_list = []
for i in range(n):
    a,b=input().split()
    res_list.append((a,int(b)))
psorted_res_list = sorted(res_list, key=lambda x: x[1], reverse=True)
sorted_res_list = sorted(psorted_res_list, key=lambda x: x[0])
for i in range(n):
    print(res_list.index(sorted_res_list[i]) + 1)

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())

cities = []
for i in range(1, n+1):
    a,b = input().split()
    b = int(b)
    cities.append([i, a, b])
    
cities = sorted(cities, key=lambda x : x[2])
print(cities)
cities.reverse()
print(cities)
cities = sorted(cities, key=lambda x: x[1])
print(cities)
for i in cities:
    print(i[0])

n = int(input())
 
cities = []
for i in range(1, n+1):
    a,b = input().split()
    b = int(b)
    cities.append([i, a, b])
    
cities = sorted(cities, key=lambda x : x[2])
#print(cities)
cities.reverse()
#print(cities)
cities = sorted(cities, key=lambda x: x[1])
#print(cities)
for i in cities:
    print(i[0])

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
a = []
n = int(input())

for i in range(1,n+1):
  name,score = map(int,input().split())
  a.append([name,-int(score),i])
  
a.sort()
for n,s,idx in a:
  print(idx)
 


a = []
n = int(input())

for i in range(1,n+1):
  name,score =input().split()
  a.append([name,-int(score),i])
  
a.sort()
for n,s,idx in a:
  print(idx)
 


Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
lst = []
for i in range(N):
  data = input().split(" ")
  lst.append([data[0], int(data[1]), i+1])
 
s = sorted(lst, key = lambda x: (x[0], x[1]))
 
for i in s:
  print(i[2])

N = int(input())
lst = []
for i in range(N):
  data = input().split(" ")
  lst.append([data[0], int(data[1]), i+1])
 
s = sorted(lst)
 
for i in s:
  print(i[2])

N = int(input())
lst = []
for i in range(N):
  data = input().split(" ")
  lst.append([data[0], int(data[1]), i+1])

s = sorted(lst, key = lambda x: (x[1], x[2]))

for i in s:
  print(i[2])

N = int(input())
lst = []
for i in range(N):
  data = input().split(" ")
  lst.append([data[0], -int(data[1]), i+1])
 
s = sorted(lst, key = lambda x: (x[0], x[1]))
 
for i in s:
  print(i[2])

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
re = []
for i in range(N):
    re.append(list(input().split()) + [i+1])
for i in range(N):
    re[i][1] = int(re[i][1])
re = sorted(re, key = lambda x: x[1], reverse = True)
re = sorted(re, key = lambda x: x[0])
print(re)
for i in range(N):
    print(re[i][2])


N = int(input())
re = []
for i in range(N):
    re.append(list(input().split()) + [i+1])
for i in range(N):
    re[i][1] = int(re[i][1])
re = sorted(re, key = lambda x: x[1], reverse = True)
re = sorted(re, key = lambda x: x[0])

for i in range(N):
    print(re[i][2])


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
from operator import itemgetter
n = int(input())
sp = []
for i in range(n):
         s,p = input().split()
         tmp = [s,100-int(p),i]
         sp.append(tmp)
print(sp)
sp = sorted(sp,key = itemgetter(0,1))
print(sp)
for i in range(n):
         print(sp[i][2]+1)


from operator import itemgetter
n = int(input())
sp = []
for i in range(n):
         s,p = input().split()
         tmp = [s,100-int(p),i]
         sp.append(tmp)
sp = sorted(sp,key = itemgetter(0,1))
for i in range(n):
         print(sp[i][2]+1)


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
names = set()
citydict = dict()
for i in range(N):
    S, P = input().split()
    names.append(S)
    if S[i] in citydict:
        citydict[S].append((int(P),i))
    else:
        citydict[S] = [(int(P),i)]

for name in sorted(names):
    for point in sorted(citydict[name],reverse = True)
        print(point[1] + 1)

N = int(input())
names = set()
citydict = dict()
for i in range(N):
    S,P = input().split()
    names.add(S)
    if S[i] in citydict:
        citydict[S].append((int(P),i))
    else:
        citydict[S] = [(int(P),i)]

for name in sorted(names):
    for point in sorted(citydict[name],reverse = True):
        print(point[1] + 1)

N = int(input())
names = set()
citydict = dict()
for i in range(N):
    S,P = input().split()
    names.add(S)
    if S in citydict:
        citydict[S].append((int(P),i))
    else:
        citydict[S] = [(int(P),i)]

for name in sorted(names):
    for point in sorted(citydict[name],reverse = True):
        print(point[1] + 1)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
rest = dict()
for i in range(int(input())):
    name, score = input().split(" ")
    rest[i+1] = int(score)
[print(i) for i, j in sorted(rest.items(), key=lambda x: x[1], reverse=True)]


source = []
for i in range(int(input())):
    name, score = input().split(" ")
    source.append([i+1, name, 100-int(score)])
[print(i[0]) for i in sorted(source, key=lambda x: (x[1], x[2]))]


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
x = [list(map(str,input().split())) for _ in range(N)]
x_new=[]
for i in range(N):
  x_new.append([i+1,x[i][0],int(x[i][1])])
   
x_new.sort(reverse=True,key=lambda x: x[2])
x_new.sort(key=lambda x: x[1])

for j in range(N):
  x_new[j].append(j+1)
x_new.sort(key=lambda x:x[0])
for u in range(N):
  print(x_new[u][3])

N = int(input())
x = [list(map(str,input().split())) for _ in range(N)]
x_new=[]
for i in range(N):
  x_new.append([i+1,x[i][0],int(x[i][1])])
   
x_new.sort(key=lambda x: x[2],reverse=True)
x_new.sort(key=lambda x: x[1])

for j in x_new:
  print(j[0])

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
SP = []
for i in range(N):
  S,P = input().split()
  P = int(P)
  SP.append(S,P,i+1)
SP.sort()
for a,b,c in SP:
  print(c)

N = int(input())
SP = [list(map(int,input().split()))for _ in range(N)]
SP.sort()
for i in SP.values():
  print(i)
  

N = int(input())
SP = []
for i in range(N):
  S,P = map(int,input().split())
  P = int(P)
  SP.append(S,P,i+1)
SP.sort()
for a,b,c in SP:
  print(c)

N = int(input())
SP = []
for i in range(N):
  S,P = input().split()
  P = int(P)
  SP.append(S,-P,i+1)
SP.sort()
for a,b,c in SP:
  print(c)

N = int(input())
SP = []
for i in range(N):
  S,P = input().split()
  P = int(P)
  SP.append((S,-P,i+1))
SP.sort()
for a,b,c in SP:
  print(c)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
res = []
 
for i in range(n):
    x, y = input().split()
    y = int(y)
    res.append((x, y, i))
 
res.sort(key=lambda x: (x[0], -x[1]))
 
for x, y, i in sp:
    print(i+1)

n = int(input())
res = []
 
for i in range(n):
    x, y = input().split()
    y = int(y)
    res.append((x, y, i))
 
res.sort(key=lambda x: (x[0], -x[1]))
 
for x, y, i in res:
    print(i+1)

Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
s = set()       
a = []          
b = dict()          
c = []          

for i in range(n):
    t = list(input().split())
    t[1] = int(t[1])
    t.append(i+1)
    a.append(t)
    s.add(t[0])

s = list(s)
s.sort()

for j in range(len(s)):
    b = dict()
    for k in range(n):
        if a[k][0] == s[j]:
            b[a[k][2]] = a[k][1]
    x = sorted(b.items(),key=lambda x:x[1],reverse=True)
    for l in range(len(x)):
        c.append(x[l][0])

print(c)

n = int(input())
s = set()       
a = []          
b = dict()          
c = []          

for i in range(n):
    t = list(input().split())
    t[1] = int(t[1])
    t.append(i+1)
    a.append(t)
    s.add(t[0])

s = list(s)
s.sort()

for j in range(len(s)):
    b = dict()
    for k in range(n):
        if a[k][0] == s[j]:
            b[a[k][2]] = a[k][1]
    x = sorted(b.items(),key=lambda x:x[1],reverse=True)
    for l in range(len(x)):
        c.append(x[l][0])

for m in range(len(c)):
    print(c[m])

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
for i in range(1, n+1):
  hoge = list(map(int, input().split()))
  hoge.append(i)
  r.append(hoge) 
tmp = sorted(r, key=lambda x:x[1], reverse=True)
res = sorted(tmp, key=lambda x:x[0])
for arr in res:
  print(arr[2])

n = int(input())
r = [list(map(int, input().split())).append(i+1) for i in range(n)] 
tmp = sorted(data, key=lambda x:x[1], reverse=True)
res = sorted(tmp, key=lambda x:x[0])
for arr in res:
  print(arr[2])

n = int(input())
r = [list(map(int, input().split())).append(i+1) for i in range(n)] 
tmp = sorted(r, key=lambda x:x[1], reverse=True)
res = sorted(tmp, key=lambda x:x[0])
for arr in res:
  print(arr[2])

n = int(input())
r = []
for i in range(1, n+1):
  hoge = list(map(int, input().split()))
  hoge.append(i)
  r.append(hoge) 
tmp = sorted(r, key=lambda x:x[1], reverse=True)
res = sorted(tmp, key=lambda x:x[0])
for arr in res:
  print(arr[2])

n = int(input())
r = []
for i in range(1, n+1):
  hoge = input().split()
  hoge.append(i)
  r.append(hoge) 
tmp = sorted(r, key=lambda x:int(x[1]), reverse=True)
res = sorted(tmp, key=lambda x:x[0])
for arr in res:
  print(arr[2])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
l = []
for i in range(N):
  a, b = input().split()
  l.append((i+1, a, int(b)))
  
l = sorted(l, key=lambda x: (x[1],x[2]))
for i in l:
  print(i[0])

n = int(input())
l = []
for i in range(n):
  a, b = input().split()
  l.append((i+1, a, int(b)))
  
l = sorted(l, key=lambda x: (x[1],-x[2]))
for i in l:
  print(i[0])


Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
import copy

N = int(input())

S = []
P = []
for i in range(N):
	s, p = input().split()
	S.insert(i, s)
	P.insert(i, p)
print(S)
print(P)

list = []
for i in range(N):
	temp = [S[i], int(P[i])]
	list.append(temp)

clone = copy.copy(list)

clone.sort(key=lambda x:x[1], reverse=True)
clone.sort(key=lambda x:x[0], reverse=False)

print(list)
print(clone)

for i in range(N):
	print(list.index(clone[i])+1)


import copy

N = int(input())

S = []
P = []
for i in range(N):
	s, p = input().split()
	S.insert(i, s)
	P.insert(i, p)

list = []
for i in range(N):
	temp = [S[i], int(P[i])]
	list.append(temp)

clone = copy.copy(list)

clone.sort(key=lambda x:x[1], reverse=True)
clone.sort(key=lambda x:x[0], reverse=False)

for i in range(N):
	print(list.index(clone[i])+1)


Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int( input() )
cities = {}
for i in range(1, N+1):
    a,b = input().split() 
    b = int(b)
    cities[a] = {"point":b,"number":i}
    
cities = sorted(cities.items(),key = lambda x: x[1]["point"])
cities.reverse()
cities.sort()
for i in cities:
    print(i[1]["number"])

N = int( input() )
cities = []
for i in range(1, N+1):
    a,b = input().split() 
    b = int(b)
    cities.append([i,a,b])
    
cities = sorted(cities,key = lambda x: x[2])
cities.reverse()
cities = sorted(cities,key = lambda x: x[1])
for i in cities:
    print(i[0])

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
a = []
for i in range(n):
    s, p = input().split()

    p = int(p)

    a.append([i+1, s, p])


a.sort(key=lambda x:x[2], reverse=True)

a.sort(key=lambda x:x[1])

for i in range(n):
    print(book[i][0])

n = int(input())
a = []
for i in range(n):
    s, p = input().split()

    p = int(p)

    a.append([i+1, s, p])


a.sort(key=lambda x:x[2], reverse=True)

a.sort(key=lambda x:x[1])

for i in range(n):
    print(a[i][0])

Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n = int(input())
lst = [list(input().split())+[i+1] for i in range(n)]

print(lst)

lst = sorted(lst, key=lambda x: (x[0], -int(x[1])))

for i in range(0, len(lst)):
    print(i[2])

n = int(input())
lst = [list(input().split())+[i+1] for i in range(n)]

# print(lst)

lst = sorted(lst, key=lambda x: (x[0], -int(x[1])))

for i in range(0, len(lst)):
    print(lst[i][2])

Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
lst = []
for i in range(N):
  city, score = map(int, input().split())
  lst.append((city, score, i+1))

lst.sort(key=lambda x: x[1], reverse=True)
lst.sort(key=lambda x: x[0])
for tup in lst:
  c, s, i = tup
  print(i)

from sys import stdin

N = int(input())
lst = []
for i in range(N):
    city, score = stdin.readline().split()
    lst.append((city, int(score), i + 1))

lst.sort(key=lambda x: x[1], reverse=True)
lst.sort(key=lambda x: x[0])
for tup in lst:
    c, s, i = tup
    print(i)


Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
S = sorted((map(lambda y: (y[0], -int(y[1]), x), input().split()) for x in range(1, N+1)))
for x in S:
  print(x[2])


N = int(input())
S = sorted((list((lambda y: (y[0], -int(y[1]), x))(input().split()))) for x in range(1, N+1))

for x in S:
  print(x[2])


Verdicts: Runtime Error

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
from operator import itemgetter
n=int(input())
s=[input().split() for i in range(n)]
t=sorted(s,key=lambda x:(x[0],-int(x[1])))
print(s)
print(t)
for i in s:
  print(t.index(i)+1)

from operator import itemgetter
n=int(input())
s=[input().split() for i in range(n)]
t=sorted(s,key=lambda x:(x[0],-int(x[1])))
for i in s:
  print(t.index(i)+1)

from operator import itemgetter
n=int(input())
s=[input().split() for i in range(n)]
t=sorted(s,key=lambda x:(x[0],-int(x[1])))
[print(s.index(i)+1) for i in t]

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
N = int(input())
SP = [input().split() for _ in range(N)]
ans = [0] * N
tmp = sorted(SP, key=lambda x:(x[0],x[1]))
cnt = 0

for s, p in SP:
    for i in range(N):
        if tmp[i][0]==s and tmp[i][1]==p:
            ans[cnt] = i
    cnt += 1

for i in range(N):
    print(ans[i])

N = int(input())
ans = []

for i in range(1, N+1):
    S, P = input().split()
    ans.append((S, P, i))

ans = sorted(ans, key=lambda x: (x[0], -int(x[1])))

for i in range(N):
    print(ans[i][2])

Verdicts: Wrong Answer

Accepted
Problem: You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.  You want to introduce the restaurants in the following order:    * The restaurants are arranged in lexicographical order of the names of their cities.   * If there are multiple restaurants in the same city, they are arranged in descending order of score.  Print the identification numbers of the restaurants in the order they are introduced in the book.

Submission attempts (in order):
n=int(input())

lst=[]
for i in range(1, N+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])


n=int(input())

lst=[]
for i in range(1, N+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])


n=int(input())

lst=[]
for i in range(1, n+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])


Verdicts: Runtime Error

Runtime Error

Accepted