TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
# -*- coding: utf-8 -*-

import sys
s = sys.stdin.readlines()
N, Q = map(int, s[0].split())
x_dict = {}
max_x = 0
for e in s[1:N]:
    S, T, X = map(int, e.split())
    if X in x_dict:
        for i in range(S - 1, T):
            x_dict[X].add(i + 0.5)
    else:
        x_dict[X] = {S - 0.5}
        for i in range(S, T):
            x_dict[X].add(i + 0.5)
    if max_x < X:
        max_x = X
for e in s[N + 1:]:
    D = int(e)
    place = 0
    inf_flg = 1
    for i in range(max_x + 1):
        time = D + i + 0.5
        if place in x_dict:
            if time in x_dict[place]:
                print(place)
                inf_flg = 0
                break
        place += 1
    if inf_flg == 1:
        print(-1)

# -*- coding: utf-8 -*-

A, P = map(int, input().split())

print((3 * A + P) // 2)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, p = map(int, input().split())
print(a + p//3)

a, p = map(int, input().split())
print((3*a+p)//2)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int,input().split())
print((3 * a + p) / 2)


a,p=map(int,input().split())
print(int((3 * a + p) / 2))


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
print(eval(input().replace(" ","//")))

a,p=map(int,input().split())
print((a*3+p)//2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a=input()
b=input()
print((a*3+b)/2)

a,p=map(int,input().split())
print((a*3+p)//2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, p = map(int, input().split())

pis = (3a + p)//2
print(pis)

a, p = map(int, input().split())

pies = (3*a + p) // 2
print(pies)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A = input()
P = input()

pi = round((A*3 + P)/2)

print(pi)



pi = round((A*3 + P)/2)




return pi

a,p = input().split()
int(a)
int(p)
print((a*3+p)//2)

A = int(input())
P = int(input())
 
pi = round((A*3 + P)/2)
 
print(pi)


pi = (A*3 + P)/2

return pi

a,p=map(int,input().split())
print((a*3+p)//2)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

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

if (a*3+p) % 2 == 1:
    print((a*3+p-1)/2)
else:
    print((a*3+p)/2)


a,p = [int(i) for i in input().split()]
print(int((a*3+p)/2))


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a = int(input())
b = int(input())
print((a*3 + b) // 2)


a, b = map(int, input().split())
print((a*3 + b) // 2)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p = map(int,input().split())
ans = (2*a + P)//2
print(ans)

a,p = map(int,input().split())
ans = (3*a + p)//2
print(ans)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
num = input().split()

sum_apple = int(num[0])*3 + int(num[1])

print(sum_apple//3)

num = input().split()

sum_apple = int(num[0]) * 3 + int(num[1])

print(sum_apple//2)


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P=map(int,input().split(" "))

B=A*3
Ans=B//2

print(Ans)

A,P=map(int,input().split(" "))

B=A*3+P
Ans=B//2

print(Ans)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p = map(int,input().split())
 print(int((a*3+p)//2))

a,p = map(int,input().split())
print((a*3+p)//2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int,input().split())
print((a*3+p)//2))

A, P = map(int, input().split())
print((A*3+P)//2)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import copy

N, K = map(int, input().split())
V = [int(i) for i in input().split()]

value = 0

num = min(N,K)
for k in reversed(range(num)):
    for ret in range(K-k): 
        if (ret < k+1):
            for i in range(k+1+1): 
                tmp = []
                V_tmp = copy.copy(V)
                tmp.extend(V_tmp[:i]) 
                V_tmp = V_tmp[i:]
                if (k+1-i) > 0:
                    tmp.extend(V_tmp[-(k+1-i):]) 
                if V_tmp == []:
                    break
                tmp = list(filter(lambda x: x not in sorted(tmp)[:ret],tmp))
                value = max(value,sum(tmp))
print(value)

inp = input()
A = int(inp.split()[0])
P = int(inp.split()[1])
result = int((A*3+P)/2)

inp = input()
A = int(inp.split()[0])
P = int(inp.split()[1])
result = int((A*3+P)/2)
print(result)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int,input())
print((3*a+p)//2)

a,p=map(int,input().split())
print((3*a+p)//2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
arguments = input()
arguments_as_list = arguments.split(" ")
list_to_integer = list(map(int, arguments_as_list))
apples = list_to_integer[0]
pieces = list_to_integer[1]
 
print((apples//3 + pieces)//2)

def applpie(apples, pieces):
  x = apples//3
  y = apples + pieces
   return y//2

arguments = input()
arguments_as_list = arguments.split(" ")
list_to_integer = list(map(int, arguments_as_list))
apples = list_to_integer(0)
pieces = list_to_integer(1)

print((apples//3 + pieces)//2)

arguments = input("test")
arguments_as_list = arguments.split(" ")
list_to_integer = list(map(int, arguments_as_list))
apples_pieces = list_to_integer[0]*3
pieces = list_to_integer[1]


print(int((apples + pieces)//2))



arguments = input()
arguments_as_list = arguments.split(" ")
list_to_integer = list(map(int, arguments_as_list))
apples_pieces = list_to_integer[0]*3
pieces = list_to_integer[1]


print(int((apples_pieces + pieces)//2))



Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = map(int, input().split())
print(((A*3)+P))//2)

A,P = map(int,input().split())
print((3*A+P)//2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int,input().split())
ap=(a*3+p)
if ap%2==0:
    print(ap/2)
else:
    print((ap-1)/2)

a,p=map(int,input().split())
ap=(a*3+p)
if ap%2==0:
    print(int(ap/2))
else:
    print(int((ap-1)/2))

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
N=input()
N=int(N)
S=[100]*N
P=[100]*N
for num in range(N):
    S[num]=input().split()
    S[num].append(num+1)
    S[num][1]=int(S[num][1])

S.sort()
flag=0
flag2=0
while(flag==0):
    flag2=0
    for num in range(0,N-1):
        if(S[num][0]==S[num+1][0]):
            if(S[num][1]<S[num+1][1]):
                S[num],S[num+1]=S[num+1],S[num]
                flag2=1
    if(flag2==0):
        flag=1
    
            

for num in range(N):
    print(S[num][2])


A,P=input().split()
A=int(A)
P=int(P)
print((A*3+P)//2)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
from operator import itemgetter

def input_list(num,args):
    for i in range(num):
        S,P = input().split()
        P=int(P)
        if 1<=len(S)<=10 and S.islower()==1 and S.isalpha()==1 \
           and 0<=P<=100 and isinstance(P,int)==1:
            args.append([S,P])
        else :
            print("ERROR")
            exit()

def sort_list(*args):
    tmp=sorted(args,key=itemgetter(1),reverse=1)
    dict_sorted=sorted(tmp,key=itemgetter(0))

    return dict_sorted


def check_list(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    if len(seq) != len(unique_list):
        print("ERORR")
        exit()
    # else :                                                                                         
    #     print("restaurant is ok.") 
   
  
def main():
    # restaurant=[['N1',88],['N2',85],['N3',92],['N7',21],['N4',34],['N8',45],['N2',24],['N2',35]]   
    # num=8                                                                                          

    num=int(input())
    if 1<=num<=100:
        
        restaurant=[]
        input_list(num,restaurant)

        check_list(restaurant)

        # print(restaurant)                                                                          
        restaurant_sorted=sort_list(*restaurant)

        for i in range(num):
            for j in range(num):
                if restaurant_sorted[i][1]==restaurant[j][1]:
                    print(j+1)
    else :
        print("ERORR")
        exit()

if __name__ == "__main__":
    main()



#!/work/yota509/env_python3/bin/python3
# -*- coding: utf-8 -*-

#apple_pie



# 0<=A,P<=100
import argparse
import math
import sys
args = sys.argv
A = int(args[1])
P = int(args[2])

Pi = math.floor((3*A +P)/2)
print(Pi)

import math
import sys
args = sys.argv
A = int(args[1])
P = int(args[2])
if 0<=A and P<=100 :
    Pi = math.floor((3*A +P)/2)
    print(Pi)

import math
import sys

args = sys.argv
A = int(args[1])
P = int(args[2])

if 0<=A and P<=100 :
    Pi = math.floor((3*A +P)/2)
    print(Pi)
else :
    print("ERROR")

import math

A,P=map(int, input().split())

if 0<=A and P<=100 :
    Pi = math.floor((3*A +P)/2)
    print(Pi)
else :
    print("ERROR")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,b = map(int, input().split())
part = int(a * 3) + b
print(part)
print(int(part / 2))


a,b = map(int, input().split())
part = int(a * 3) + b
print(int(part / 2))

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
def main():
    A, P = (int(i) for i in input().split())
    output = (3*A+P)/2
    print(output)
    return output

main()

A,P = map(int, input().split())
num_pie=int((3*A+P)//2)
print(num_pie)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int,input().split())
print((a+p//3)//2)

a,p=map(int,input().split())
print((3*a+p)//2)


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, p = map(int, input("A P").split(" "))

SUM = a * 3 + p

print(int(SUM / 2))


a, p = map(int, input().split(" "))

SUM = a * 3 + p

print(int(SUM / 2))


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

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

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

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


a, p = map(int,input().split())

print((3*a + p) // 2)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, b = list(map(int, input().split()))

print(((a * 3) + b) / 2)


a, b = list(map(int, input().split()))

print(int(((a * 3) + b) / 2))


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import sys
import math


def main():
    a = int(sys.argv[1])
    p = int(sys.argv[2])
    return math.floor((a * 3 + p) / 2)


if __name__ == '__main__':
    print(main())


# -*- coding: utf-8 -*-
import math


def main():
    inp = input().split()
    a = int(inp[0])
    p = int(inp[1])
    return math.floor((a * 3 + p) / 2)


if __name__ == '__main__':
    print(main())


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
apple = int(input('りんごの個数') * 3)
piece = int(input('りんごの破片の数'))

apple_pie = (apple + piece) // 2
print(apple_pie)

A, P = [int(i) for i in input().split()]
print((A * 3 + P) // 2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import sys

for l in sys.stdin:
  a, p = l.rstrip('\n').split(' ')
pies = (int(a) * 3 + p) //2
print(pies)

import sys

for l in sys.stdin:
  a, p = l.rstrip('\n').split(' ')
pies = (3*a+p)//2
print(pies)

import sys

for l in sys.stdin:
  a, p = l.rstrip('\n').split(' ')
pies = (int(a) * 3 + int(p)) //2
print(pies)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, p = mao(int, input().split())
print((a * 3 + p) // 2)

a, p = map(int, input().split())
print((a * 3 + p) // 2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p = map(int,input().split())
print(a*3 + p // 2)

a,p = map(int,input().split())
a == a*3*p
a + p == int,ap
print(ap)


a,p = map(int,input().split())
ap = (int,input())
a == 3*p
a + p == ap
print(ap)

a,p = map(int,input().split())
print((a*3+p)//2)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = map(int, input().split())

a = int(A/3)

ans = int((a + P)/2)

print(ans)

A,P = map(int, input().split())
 
a = int(A*3)
 
ans = int((a + P)/2)
 
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = map(int, input().split())
sum_apple = A*3+P
print(sum_apple/2)

A,P = map(int, input().split())
sum_apple = A*3+P
print(int(sum_apple/2))


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import sys
a = sys.argv[1]
p = sys.argv[2]
a1 = a*3
print ((a1+p)/2)

from sys import stdin
arg = stdin.readline().rstrip().split()
a = int(arg[0])
p = int(arg[1])
a1 = a*3
print (int((a1+p)/2))

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
print(a)

A, P = map(int, input().split())
print((P+A*3)//2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
input_AP = list(map(int, input().split()))
A = input_AP[0]
P = input_AP[1]

result = (A+P)*3//2
print(result)

N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1)

N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1)

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

B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1)


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


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

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


N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2])+1

N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


values = [i for i in range(N)]

dic = dict(zip(A, values))

B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

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

input_AP = list(map(int, input().split()))
A = input_AP[0]
P = input_AP[1]

result = A*3//2
print(result)

input_AP = list(map(int, input().split()))
A = input_AP[0]
P = input_AP[1]

result = A*3//2

N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i))


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2]+1)


N = int(input())
A = []
for i in range(N):
    A[i] = list(map(int,input().split()))

print(A)

input_AP = list(map(int, input().split()))
A = input_AP[0]
P = input_AP[1]

result = (A*3 + P)//2
print(result)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = input().split(" ")
A=int(A)
P=int(P)

print(A)
print(P)

P += A*3

print(P)
pie = int(P/3)

print(pie)

A,P = input().split(" ")
A=int(A)
P=int(P)

print(A)
print(P)

P += A*3

print(P)
pie = int(P/2)

print(pie)

A,P = input().split(" ")
A=int(A)
P=int(P)

P += A*3

pie = int(P/2)

print(pie)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [a for a in lis]
 
list1.sort(key=lambda a: int(a[1]), reverse=True)
list1.sort(key=lambda a: a[0])
 
 
for i in lis:
    print(i[2])

N = int(input())
lis = [(input() + " " + str(i+1)).split() for i in range(N)]
 
lis = [k for k in lis]
 
lis.sort(key=lambda k: int(k[1]), reverse=True)
lis.sort(key=lambda k: k[0])
 
 
for j in lis:
    print(j[2])


N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [k for k in list1]
 
list1.sort(key=lambda k: int(k[1]), reverse=True)
list1.sort(key=lambda k: k[0])
 
 
for i in list1:
    print(i[2])


N = int(input())
list1 = [(input() + " " + str(i+1)).split() for i in range(N)]
 
list1 = [a for a in lis]
 
list1.sort(key=lambda a: int(a[1]), reverse=True)
list1.sort(key=lambda a: a[0])
 
 
for i in list1:
    print(i[2])


try:
    a,p=map(int, input().split())
    assert 0<=a,p<=100
    print(((a*3)+p)//2)
except AssertionError:
    print('')


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import numpy as np
A, P = map(int, input().split())
print((A/3+P)/2)

import numpy as np
A, P = map(int, input().split())
print((A*3+P)//2)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = map(int,input().split())
print((A*3+P)/2)

A,P = map(int,input().split())
print((A*3+P)//2)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = map(int,input().split())
print((A**3+P)//2)

A,P = map(int,input().split())
print((A*3+P)//2)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
x,y = map(int,input().split())
a = (3*x+2)//2
print(a)

x,y = map(int,input().split())
a = (3*x+y)//2
print(a)


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
N, M = map(int, input().split())
n_switch = []
switch = []
for i in range(M):
	s = list(map(int, input().split()))
	n_switch.append(s[0])
	switch.append(s[1:])
p = list(map(int, input().split()))
ans = 0
for i in range(2 ** N):
	x = 1
	b = bin(i)[2:].rjust(N, '0')
	for j in range(M):
		n_light = 0
		for k in range(n_switch[j]):
			if b[switch[j][k] - 1] == '1':
				n_light += 1
		if n_light % 2 != p[j]:
			x *= 0
			break
	if x == 1:
		ans += 1
print(ans)

A, P = map(int, input().split())
print((3 * A + P) // 2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import itertools

def is_lit(i, bit):
    l = [bit[j-1] for j in sockets[i]]
    return p[i] == l.count(True) % 2

count = 0
N, M = map(int, input().split())
bit_list = list(itertools.product([True, False], repeat = N))

sockets = []
for i in range(M):
    args = input().split(' ')
    k = int(args[0])
    sockets.append([int(args[i+1]) for i in range(k)])

p = [int(x) for x in input().split(' ')]

for bit in bit_list:
    o = [is_lit(i, bit) for i in range(M)]
    if o.count(True) == len(o):
        count += 1

print(count)


import sys
A ,P = map(int,input().split())
print(int((3*A + P) /2))


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
li = list(int(input()))
print(int((li[0]*3+li[1])/2))

li = list(map(int, input().split()))
print(int((li[0]*3+li[1])/2))

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = map(int,input().split())
p = A*3 + p
print(p//2)

A,P = map(int,input().split())
p = A*3 + P
print(p//2)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P=map(int,input().split())
print((A*3 + P) / 2)


A,P=map(int,input().split())
print(int((A*3 + P) / 2))


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
def pie(A, P):
    P_cra = A*3

    P_all = P_cra + P

    pie = P_all//2

    print(pie)

A, P = input(), input()
pie(A, P)
    

def pie(A, P):
    P_cra = A*3
 
    P_all = P_cra + P
 
    pie = P_all//2
 
    print(pie)

A = input()
P = input()
pie(int(A), int(P))

def pie(A, P):
    P_cra = A*3
 
    P_all = P_cra + P
 
    pie = P_all//2
 
    print(pie)

l = list(map(int, input().split()))
A = int(l[0])
P = int(l[1])
pie(A, P)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, p = [int(x) for x in input().split()]
print((a // 3 + p) // 2)

a, p = [int(x) for x in input().split()]
print((a * 3 + p) // 2)


Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int,input().split())
print(int((a*3+b)/2))

a,p=map(int,input().split())
print(int((a*3+p)/2))

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, p = map(int, input().split())
print(3 * a + p // 2)

a, p = map(int, input().split())
print((3 * a + p) // 2)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import sys
from functools import reduce
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()


import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()


import sys
from functools import reduce
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()


import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2))
a()


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
a,p=nm()
print((3*a//2))


a,p=map(int,input().split())
ans=(3*a)//2
print(ans)

a,p=map(int,input().split())
ans=(3*a+p)//2
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P = int(input())
N = 3*A+P
print(N//2)

A,P = map(int,input().split())
N = 3*A+P
print(N//2)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import numpy as np
N=int(input())
a=[]
for i in range(N):
    s,p=input().split()
    p=int(p)
    a.append([s,p,i+1])
a.sort(key=lambda x:(x[0],x[1]))
i=0
while i<=N:
    last=a[i][0]
    i+=1
    if i<N and last==a[i][0]:
        s=i-1
        g=i
        while 1:
            if i>=N or last!=a[i][0]:
                g=i
                break
            i+=1
        for j in reversed(range(s,g)):
            print(a[j][2])
        if i==N-1:
            break
    else:
        print(a[i-1][2])



A,P=map(int,input().split())
print((A*3+P)//2)

Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2¥n)
else:
    print((b-1)/2¥n)

a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2¥n)
if else:
    print((b-1)/2¥n)

a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2)
if else:
    print((b-1)/2)

a, p=map(int, input().split())
print((a*3+p)//2)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
import math
apple_one, apple_kakera = (int(i) for i in input().split())  
apple_kakera += apple_one * 3
print(math.floor(apple_one / 2) )

    import math
    apple_one, apple_kakera = (int(i) for i in input().split())  
    apple_kakera += apple_one * 3
    print(math.floor(apple_kakera / 2) )

import math
apple_one, apple_kakera = (int(i) for i in input().split())  
apple_kakera += apple_one * 3
print(math.floor(apple_kakera / 2) )

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
print((3*int(input())+int(input()))//2)

a, p = map(int, input())
print((3 * a + p) // 2)


a, p = map(int, input().split())
print((3 * a + p) // 2)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P=map(int,input().split())
ans=(3*A+P)%2
print(ans)

A,P=map(int,input().split())
ans=(3*A+P)//2
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
A,P=input().split()
print((3*A+2)//2)

s,t = map(int,input().split())
f=(s*3+t)//2
print(f)


Verdicts: Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int, input().split())
print((3a+p)//2)

a,p=map(int,input().split())
pritn((3a+p)//2)

a,p=list(map(int, input().split()))
print((3a+p)//2)

a,p=map(int,input().split())
print((3a+p)//2)

a,p=map(int, input().split())
print((3*a+p)//2)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have A apples and P pieces of apple.  We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.  Find the maximum number of apple pies we can make with what we have now.

Submission attempts (in order):
a,p=map(int,input().split())
_a=a*3
print(sum(_a+p)/2)

a,p=map(int,input().split());print(a*3+p//2)

a,p=map(int,input().split())
_a=a*3
print(int(sum(_a+p)//2))

a,p=map(int,input().split());print((a*3+p)//2)

Verdicts: Runtime Error

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())
L = []
i = 0
while i < n:
    s,p = map(str,input().split(' '))
    L.append((s,p,i))
    i += 1
print(L)
L.sort()
ans = ''
for l in L:
    ans += str(l[2]-1)+'\n'
print(ans[:-1])

n = int(input())
L = []
i = 0
while i < n:
    s,p = map(str,input().split(' '))
    p = int(p)
    L.append((s,p,i))
    i += 1
L.sort()
ans = ''
for l in L:
    ans += str(l[2]-1)+'\n'
print(ans[:-1])

n = int(input())
L = []
i = 0
while i < n:
    s,p = map(str,input().split(' '))
    p = int(p)
    L.append((s,p,i))
    i += 1
L.sort()
ans = ''
for l in L:
    ans += str(l[2]+1)+'\n'
print(ans)

n = int(input())
L = []
i = 0
while i < n:
    s,p = map(str,input().split(' '))
    p = int(p)
    L.append((s,p,i))
    i += 1
L.sort()
ans = ''
for l in L:
    ans += str(l[2]+1)+'\n'
print(ans[:-1])

n = int(input())
L = []
i = 0
while i < n:
    s,p = map(str,input().split(' '))
    p = -1*int(p)
    L.append((s,p,i))
    i += 1
L.sort()
ans = ''
for l in L:
    ans += str(l[2]+1)+'\n'
print(ans[:-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())
SP = []
for i in range(n):
    s,p = input().split()
    sp = (i,s,int(p))
    SP.append(sp)

newSP = sorted(SP,key = lambda tup:(tup[1],-tup[2]))

print(newSP)

for i in range(n):
    print(newSP[i][0] + 1)


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

newSP = sorted(SP,key = lambda tup:(tup[1],-tup[2]))

for i in range(n):
    print(newSP[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())
R = [input().split() + [i+1] for i in range(N)]
print(R)
R.sort(key=lambda x: -int(x[1]))
R.sort(key=lambda x: x[0])
[print(n) for _, _, n in R]

N = int(input())
R = [input().split() + [i+1] for i in range(N)]
# print(R)
R.sort(key=lambda x: -int(x[1]))
R.sort(key=lambda x: x[0])
[print(n) for _, _, n in R]


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())
r = []

for i in range(1, N+1):
    name, point = (x for x in input().split())
    r.append([name, point, i])
r.sort(key=lambda x: x[0])
r.sort(key=lambda x: x[1])

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


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

for i in range(1, N+1):
    name, point = (x for x in input().split())
    r.append([name, int(point), i])
    r.sort(key=lambda x: x[1], reverse=True)
    r.sort(key=lambda x: x[0])

for i in range(N):
    print(r[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())
j = []
for _ in zip(range(N)):
    p, q = map(str, input().split())
    j.append(int(q))

for i in range(N):
    p = max(j)
    q = j.index(p)
    print(q+1)
    j[q] = -1

N = int(input())
j = []
for _ in zip(range(N)):
    p, q = map(str, input().split())
    j.append(int(q))

for i in range(N):
    p = max(j)
    q = j.index(p)
    print(q+1)
    j[q] = 0

N = int(input())
s = {}
for _, i in zip(range(N), range(N)):
    p, q = map(str, input().split)
    s[q] = i
    
s.sort()

for i in range(N):
    print(s[i])aN = int(input())
j = []
for _, i in zip(range(N), range(N)):
    p, q = map(str, input().split())
    j.append(int(q))

for i in range(N):
    p = max(j)
    q = j.index(p)
    print(q+1)
    j[q] = 0

n = int(input())
key = []
for i in range(n):
  flag = True
  s, p = map(str, input().split())
  for j in range(len(key)):
    if key[j][0] == s:
      key[j][1].append([int(p), i+1])
      flag = False
      break
  if flag:
    key.append([s, [[int(p), i+1]]])
key.sort()
for i in range(len(key)):
  key[i][1].sort(reverse=True)
  for j in range(len(key[i][1])):
    print(key[i][1][j][1])

Verdicts: Wrong Answer

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())
lis = []
for i in range(n):
    s,p = map(str,input().split())
    lis.append([s,100 - int(p)])
liss = lis.copy()
lis.sort()
print(liss)
for i in range(n):
    print(liss.index(lis[i]) + 1)

n = int(input())
lis = []
for i in range(n):
    s,p = map(str,input().split())
    lis.append([s,100 - int(p)])
liss = lis.copy()
lis.sort()
print(liss)
for i in range(n):
    print(lis.index(liss[i]) + 1)

n = int(input())
lis = []
for i in range(n):
    s,p = map(str,input().split())
    lis.append([s,100 - int(p)])
liss = lis.copy()
lis.sort()
for i in range(n):
    print(liss.index(lis[i]) + 1)

Verdicts: Wrong Answer

Wrong Answer

Accepted