TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n, m = map(int, input().split())
a = []
for i in range(m):
	a.append([int(n) for n in input().split()])
	a[i].append(i)
print(a)
b = []
counter = 0
counter1 = 1
for i in range(m):
	c = ""
	if a[i][0] < 100000:
		getlen = len(str(a[i][0]))
		c = "0" * (6 - getlen) + str(a[i][0])
	else:
		c = str(a[i][0])
	if i == 0:
		c += "000001"
		counter = a[0][0]
	elif a[i][0] == counter:
		getlen = len(str(counter1 + 1))
		c += "0" * (6 - getlen) + str(counter1 + 1)
		counter1 += 1
	else:
		counter1 = 1
		c += "000001"
		counter = a[i][0]
	a[i].append(c)

for i in range(m):
	a[i][2], a[i][0] = a[i][0], a[i][2]
a = sorted(a)
for i in range(m):
	print(a[i][3])

n, m = map(int, input().split())
a = []
for i in range(m):
	a.append([int(n) for n in input().split()])
	a[i].append(i)
a = sorted(a)
b = []
counter = 0
counter1 = 1
for i in range(m):
	c = ""
	if a[i][0] < 100000:
		getlen = len(str(a[i][0]))
		c = "0" * (6 - getlen) + str(a[i][0])
	else:
		c = str(a[i][0])
	if i == 0:
		c += "000001"
		counter = a[0][0]
	elif a[i][0] == counter:
		getlen = len(str(counter1 + 1))
		c += "0" * (6 - getlen) + str(counter1 + 1)
		counter1 += 1
	else:
		counter1 = 1
		c += "000001"
		counter = a[i][0]
	a[i].append(c)

for i in range(m):
	a[i][2], a[i][0] = a[i][0], a[i][2]
a = sorted(a)
for i in range(m):
	print(a[i][3])

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n,m=map(int,input().split())
temp=[0]*m
for i in range(0,m):
  p,y=map(int,input().split())
  temp[i]=[i,p,y]
temp.sort(key=lambda x: x[2])  
temp.sort(key=lambda x: x[1])  
print(temp)
j=1
n=1
for i in range(0,m):
  if temp[i][1]==n:
    tempn=str(n)
    tempj=str(j)
    temp[i][1]=tempn.zfill(6)
    temp[i][2]=tempj.zfill(6)
    j=j+1
  else:
    n=n+1
    j=1
    tempn=str(n)
    tempj=str(j)
    temp[i][1]=tempn.zfill(6)
    temp[i][2]=tempj.zfill(6)
    j=j+1
temp.sort(key=lambda x: x[0])
for i in range(0,m):
  print(temp[i][1]+temp[i][2])

n,m=map(int,input().split())
temp=[0]*m
tempn=[]
for i in range(0,m):
  p,y=map(int,input().split())
  temp[i]=[i,p,y]
  tempn.append(p)
temp.sort(key=lambda x: x[2])  
temp.sort(key=lambda x: x[1])  
j=1
tempn=list(set(tempn))
tempn.sort()
k=0
n=tempn[k]
for i in range(0,m):
  if temp[i][1]==n:
    tempa=str(n)
    tempj=str(j)
    temp[i][1]=tempa.zfill(6)
    temp[i][2]=tempj.zfill(6)
    j=j+1
  else:
    k=k+1
    if k>=len(tempn):
      break
    n=tempn[k]
    j=1
    tempa=str(n)
    tempj=str(j)
    temp[i][1]=tempa.zfill(6)
    temp[i][2]=tempj.zfill(6)
    j=j+1
temp.sort(key=lambda x: x[0])
for i in range(0,m):
  print(temp[i][1]+temp[i][2])

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):


#include <map>
#include <algorithm>
#include <iomanip>
using namespace std;

int main()
{
    int N, M; cin >> N >> M;

    vector< pair<int, int> > rawInput(M);
    vector<vector<int> > prifList(N);
    map<pair<int, int>, int> answer;

    for(int i = 0; i < M; ++i)
    {
        int P, Y; cin >> P >> Y;
        rawInput.at(i) = make_pair(P, Y);
        prifList.at(P - 1).push_back(Y);
        answer[make_pair(P, Y)] = 0;
    }

    for(int i = 0; i < N; ++i)
    {
        sort(prifList.at(i).begin(), prifList.at(i).end());
        for(int j = 0; j < prifList.at(i).size(); ++j)
        {
            answer[make_pair(i+1, prifList[i][j])] = j + 1;
        }
    }
    for(int i = 0; i < M; ++i)
    {
        cout << setw(6) << setfill('0') << rawInput.at(i).first;
        cout << setw(6) << setfill('0') << answer[rawInput.at(i)] << '\n';
    }
    return 0;
}


N, M = map(int, input().split())
A = []
Plst = [list() for _ in range(N)]
dic = {}
for i in range(M):
    P, Y = map(int, input().split())
    A.append([i, P, Y])
    Plst[P - 1].append(Y)
    dic[(P, Y)] = 0
for i in range(N):
    Plst[i].sort()
    for j in range(len(Plst[i])):
        s = str(str(i + 1).zfill(6) + str(j + 1).zfill(6))
        dic[(i, Plst[i][j])] = s
for e in A:
    print(dic[(e[1] - 1, e[2])])


Verdicts: Runtime Error

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n, m = list(map(int, input().split()))
tmps = [[] for _ in range(n)]
pyxs = []

for i in range(m):
    p, y = list(map(int, input().split()))
    pyxs.append([p, y, i])

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

num = [0] * (n+1)
ans = []*m

for p, y, x in pyxs:
    ans[i] = '{:06}'.format(p) + '{:06}'.format(num[p]+1)
    num[p] += 1

for s in ans:
    print(s)

n, m = list(map(int, input().split()))
tmp = [[0 for i in range(1)] for j in range(m)]
pys = []
for i in range(0, m):
    p, y = list(map(int, input().split()))
    tmp[p].append(y)
    pys.append([p, y])

print(tmp)

ttmp = [[0 for i in range(1)] for j in range(m)]

for i in range(m):
    ttmp[i] = sorted(tmp[i])

print(ttmp)

for py in pys:
    p, y = py
    yindex = ttmp[p].index(y)
    print('{:06}'.format(p) + '{:06}'.format(yindex))

n, m = list(map(int, input().split()))
tmps = [[] for _ in range(n)]
pyxs = []

for i in range(m):
    p, y = list(map(int, input().split()))
    pyxs.append([p, y, i])

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

num = [0] * (n+1)
ans = [None]*m

for p, y, x in pyxs:
    ans[x] = '{:06}'.format(p) + '{:06}'.format(num[p]+1)
    num[p] += 1

for s in ans:
    print(s)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
N, M = list(map(int, input().split()))
PYs = {}
for _ in range(M):
    p, y = list(map(int, input().split()))
    if p not in PYs:
        PYs[p] = []
    PYs[p].append(y)

for p in sorted(PYs.keys()):
    str_p = '{}'.format(p).zfill(6)
    for idx, c in enumerate(sorted(PYs[p])):
        print(str_p + '{}'.format(idx + 1).zfill(6))





N, M = list(map(int, input().split()))

PYs = {}

py2nummap = {}
py2 = []
for _ in range(M):
    p, y = list(map(int, input().split()))
    if p not in PYs:
        PYs[p] = []
    PYs[p].append(y)
    py2nummap[(p,y)] = ''
    py2.append((p,y))

for p in sorted(PYs.keys()):
    str_p = '{}'.format(p).zfill(6)
    for idx, c in enumerate(sorted(PYs[p])):
        py2nummap[(p,c)] = (str_p + '{}'.format(idx + 1).zfill(6))


for y in py2:
    # print(y)
    print(py2nummap[y])
# print(py2nummap)
# print(PYs)


Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
N, M = map(int, input().split())
ken = [[] for _ in range(N)]
shi = [tuple(map(int, input().split())) for _ in range(M)]
for s1, s2 in shi:
    ken[s1-1].append(s2)
for k in ken:
    k.sort()
for s1, s2 in shi:
    print("{:06}{:06}".format(s1, ken[s1-1].index(s2+1)))

from operator import itemgetter
N, M = map(int, input().split())
iPY = [0]*M
res = [0]*M
for i in range(M):
    P, Y = map(int, input().split())
    iPY[i] = (i, P, Y)
iPY.sort(key=itemgetter(2))
iPY.sort(key=itemgetter(1))
j = 1
p = iPY[0][1]
for i, P, Y in iPY:
    if P != p:
        j = 1
        p = P
    res[i] = "{:06}{:06}".format(P, j)
    j += 1
for s in res:
    print(s)

Verdicts: Runtime Error

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
N, M = map(int, input().split())
p = list()
d = dict()
for i in range(M):
    inp = map(int, input().split())
    p.append(inp)
    if inp[0] in d:
        d[inp[0]].append(inp[1])
    else:
        d[inp[0]] = [inp[1]]
for i in d:
    d[i].sort()
for i, j in p:
    print("{:06d}{:06d}".format(i, d[i].index(j)+1))

N, M = map(int, input().split())
p = list()
y = list()
d = dict()
for i in range(N):
    inp_p, inp_y = map(int, input().split())
    p.append(inp_p)
    y.append(inp_y)
    if p in d:
        d[p].append(y)
    else:
        d[p] = [y]
for i in d:
    d[i] = sorted(d[i])
for i, j in zip(p, y):
    print("{:06d}{:06d}".format(i, d[i].index(j)+1))

N, M = map(int, input().split())
p = [[] for i in range(M)]
counter = [0] * N
ans = [""] * M

for i in range(M):
    k, y = map(int, input().split())
    p[i] = [k, y, i]

p.sort(key=lambda x:x[1])
for k, y, i in p:
    counter[k-1] += 1
    ans[i] = "{:06d}{:06d}".format(k, counter[k-1])

for i in ans:
    print(i)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
import sys
input=sys.stdin.readline

n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]
print(l)
for i in range(m):
    n=1
    for j in range(m):
        if l[i][0]==l[j][0] and l[i][1]>l[j][1]:
            n+=1
    print(str('%06d'%l[i][0])+str('%06d'%n))

import sys
input=sys.stdin.readline

n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]
#print(l)
li=[[]*n for _ in range(n)]
lis=sorted(l)
for i in lis:
    li[i[0]-1].append(i[1])
    print(li)
for i in l:
    a=li[i[0]-1].index(i[1])
    print(str('%06d'%i[0])+str('%06d'%(a+1)))        

n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]
s=[]
for i in enumerate(l):
    s.append(i)
s=sorted(s,key=lambda x:(x[1][0],x[1][1]))
#print(s)
a=1
for i in range(m):
    if i==0:
        s[0][1][1]=1
    elif s[i][1][0]==s[i-1][1][0]:
        a+=1
        s[i][1][1]=a
    elif s[i][1][0]!=s[i-1][1][0]:
        a=1
        s[i][1][1]=a
#print(s)
s=sorted(s,key=lambda x:x[0])
#print(s)
for i in s:
    print('%06d'%i[1][0]+'%06d'%i[1][1])

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n, m = map(int, input().split())

city_list = []
for i in range(m):
	p, y = map(int, input().split())
	city_list.append([i, p, y, 0])

print(city_list)
city_list = sorted(city_list, key = lambda x: x[2])
print(city_list)
city_list = sorted(city_list, key = lambda x: x[1])
print(city_list)

nowp = 1
index = 1
for city in city_list:
	if city[1] == nowp:
		city[3] = index
		index += 1
	else:
		nowp = city[1]
		index = 1
		city[3] = index
		index += 1

print(city_list)
city_list = sorted(city_list, key = lambda x: x[0])
print(city_list)

for city in city_list:
	kami_str = '0' * (6 - len(str(city[1]))) + str(city[1])
	shimo_str = '0' * (6 - len(str(city[3]))) + str(city[3])
	answer = kami_str + shimo_str
	print(answer)


n, m = map(int, input().split())

city_list = []
for i in range(m):
	p, y = map(int, input().split())
	city_list.append([i, p, y, 0])

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

nowp = 1
index = 1
for city in city_list:
	if city[1] == nowp:
		city[3] = index
		index += 1
	else:
		nowp = city[1]
		index = 1
		city[3] = index
		index += 1

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

for city in city_list:
	kami_str = '0' * (6 - len(str(city[1]))) + str(city[1])
	shimo_str = '0' * (6 - len(str(city[3]))) + str(city[3])
	answer = kami_str + shimo_str
	print(answer)


Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n, m = map(int, input().split())
tmp = [list(map(int, input().split())) for i in range(m)]
city = [[] for i in range(n+1)]
answers = [''] * m

for i, (pref, year) in enumerate(tmp):
    city[pref].append([year, i])
print(city)

for i in range(n+1):
    for j, (year, index) in enumerate(sorted(city[i])):
        ans = str(i).zfill(6) + str(j+1).zfill(6)
        answers[index] = ans

print(*answers, sep='\n')

n, m = map(int, input().split())
tmp = [list(map(int, input().split())) for i in range(m)]
city = [[] for i in range(n+1)]
answers = [''] * m

for i, (pref, year) in enumerate(tmp):
    city[pref].append([year, i])

for i in range(n+1):
    for j, (year, index) in enumerate(sorted(city[i])):
        ans = str(i).zfill(6) + str(j+1).zfill(6)
        answers[index] = ans

print(*answers, sep='\n')

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n, m = map(int, input().split())
py = [list(map(int, input().split())) for _ in range(m)]
ans_dict = {}
ans_lst = []
for i in range(m):
    if py[i][0] in ans_dict.keys():
        ans_lst.append('{:0=6}'.format(py[i][0]) +
                       '{:0=6}'.format(py[i][0]-1))
        print(ans_lst[-1])
    else:
        ans_lst.append('{:0=6}'.format(py[i][0]) +
                       '000001')
        print(ans_lst[-1])

n, m = map(int, input().split())
py = [list(map(int, input().split())) for _ in range(m)]
ans_dict = {}
ans_lst = []
for i in range(m):
    if py[i][0] in ans_dict.keys():
        ans_dict[py[i][0]] += 1
        ans_lst.append('{:0=6}'.format(py[i][0]) +
                       '{:0=6}'.format(ans_dict[py[i][0]]))
        print(ans_lst[-1])
    else:
        ans_dict[py[i][0]] = 1
        ans_lst.append('{:0=6}'.format(py[i][0]) +
                       '000001')
        print(ans_lst[-1])

n, m = map(int, input().split())
l = []
k = ['_'] * m
x = [1] * (n+1)
for i in range(m):
    a, b = map(int, input().split())
    l.append([i, a, b])
y = sorted(l, key=lambda c: c[2])
for i in y:
    k[i[0]] = str(i[1]).zfill(6) + str(x[i[1]]).zfill(6)
    x[i[1]] += 1
for i in k:
    print(i)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
N,M = map(int,input().split())
PYlist = []
for i in range(M):
    PYlist_ele = list(map(int,input().split()))
    PYlist_ele.append(i+1)
    PYlist.append(PYlist_ele)
PYlist.sort()
check = 0
count = 0
P_id = []
for i in range(M):
    if check == PYlist[i][0]:
        count +=1
    else:
        count = 1
    idup = '{:06}'.format(PYlist[i][0])
    iddown = '{:06}'.format(check)
    P_id.append([str(idup)+str(iddown),PYlist[i][2]])
P_id.sort(key=lambda x: x[1])
for ans in P_id:
    print(ans[0])

N,M = map(int,input().split())
PYlist = []
for i in range(M):
    PYlist_ele = list(map(int,input().split()))
    PYlist_ele.append(i+1)
    PYlist.append(PYlist_ele)
PYlist.sort()
check = 0
count = 0
P_id = []
for i in range(M):
    if check == PYlist[i][0]:
        count +=1
    else:
        count = 1
        check = PYlist[i][0]
    idup = '{:06}'.format(PYlist[i][0])
    iddown = '{:06}'.format(count)
    P_id.append([str(idup)+str(iddown),PYlist[i][2]])
P_id.sort(key=lambda x: x[1])
for ans in P_id:
    print(ans[0])

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
N, M = map(int, input().split())
A=[]
count=[1]*100000
number=0
for i in range(M):
    a, b, = map(int, input().split())
    A.append([b, a])

A.sort()

for i in range(M):
    number=A[i][1]*1000000+count[int(A[i][1])]
    print(str(number).zfill(12))
    count[int(A[i][1])] +=1



N, M = map(int, input().split())
A=[]
count=[1]*1000000
ans=[]
for i in range(M):
    a, b, = map(int, input().split())
    A.append([b, a, i])

A.sort()

for i in range(M):
    number=A[i][1]*1000000+count[int(A[i][1])]
    ans.append([A[i][2],str(number).zfill(12)])
    count[int(A[i][1])] +=1
ans.sort()

for i in range(M):
    print(ans[i][1])



Verdicts: Runtime Error

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
from operator import itemgetter
n,m = map(int,input().split())
lis = []
ans = [0 for i in range(m)]
num = [0 for i in range(n)]
for i in range(m):
  a,b = map(int,input().split())
  lis.append([i,a,b])
lis.sort(key=itemgetter(2))
for i in range(m):
  num[lis[i][1]-1] += 1
  cou = 6-(lis[i][1] // 10)
  co = 6-(num[lis[i][1]-1] // 10)
  ans[lis[i][0]] = "0" * cou + str(lis[i][1]) + "0" * co + str(num[lis[i][1]-1])
for i in range(m):print(ans[i])

n,m =map(int,input().split())
lis = [list(map(int,input().split())) for i in range(m)]
for i in range(m):
    lis[i].append(i)
lis.sort()
cnt = 1
ans = []
ans.append([lis[0][-1],format(lis[0][0]).zfill(6)+format(1).zfill(6)])
for i in range(m-1):
    if lis[i][0] == lis[i+1][0]:
        cnt += 1
        ans.append([lis[i+1][-1],format(lis[i+1][0]).zfill(6)+format(cnt).zfill(6)])
    else:
        cnt = 1
        ans.append([lis[i+1][-1],format(lis[i+1][0]).zfill(6)+format(cnt).zfill(6)])
ans.sort(key = lambda x:x[0])
for i,x in ans:
    print(x)

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
import bisect

N, M = map(int, input().split())
PY = []
array = [[] for _ in range(N)]

for _ in range(M):
    P, Y = map(int, input().split())
    PY.append([P, Y])
    array[P-1].append(Y)

for p, y in PY:
    n = bisect.bisect_left(array[p-1], y) + 1
    print('%06d%06d' % (p, n))


import bisect

N, M = map(int, input().split())
PY = []
array = [[] for _ in range(N)]

for _ in range(M):
    P, Y = map(int, input().split())
    PY.append([P, Y])
    array[P-1].append(Y)
    
for i in range(N):
    array[i].sort()

for p, y in PY:
    n = bisect.bisect_left(array[p-1], y) + 1
    print('%06d%06d' % (p, n))


Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
from operator import itemgetter

N,M=map(int,input().split())
PY=[]
P=[[] for i in range(N)]
ans=[0 for i in range(M)]
for i in range(M):
    PYi=list(map(int,input().split()))
    PY.append(PYi)
    P[PYi[0]-1].append([i,PYi[1]])

for i in range(N):
    P[i]=sorted(P[i], key=itemgetter(1))

for i in range(N):
    for j in range(len(P[i])):
        ans[P[i][j][0]]=j+1

print(P)
print(ans)
print(N)
for i in range(M):
    a=format(PY[i][0],'06x')
    b=format(ans[i],'06x')
    print(a+b)

from operator import itemgetter

N,M=map(int,input().split())
PY=[]
ans=[0 for i in range(M)]
cc=[0 for i in range(N)]
for i in range(M):
    PYi=list(map(int,input().split()))
    PY.append([i,PYi[0],PYi[1]])
     
PY=sorted(PY, key=itemgetter(2))

for i in range(M):
    cc[PY[i][1]-1]+=1
    ans[PY[i][0]]=cc[PY[i][1]-1]

for i in range(M):
    a=format(PY[i][1],'06d')
    b=format(ans[i],'06d')
    print(a+b)

from operator import itemgetter

N,M=map(int,input().split())
PY=[]
ans=[0 for i in range(M)]
cc=[0 for i in range(N)]
for i in range(M):
    PYi=list(map(int,input().split()))
    PY.append([i,PYi[0],PYi[1]])
     
PY=sorted(PY, key=itemgetter(2))

for i in range(M):
    cc[PY[i][1]-1]+=1
    ans[PY[i][0]]=format(PY[i][1],'06d')+format(cc[PY[i][1]-1],'06d')

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

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

def main():
    N, M =  [int(i) for i in input().split()]
    cities = []
    for i in range(M):
        p, y = map(int, input().split())
        cities.append([p, y])
    cities.sort()

    before = 0
    num = 1
    for p, y in cities:
        if before == p:
            num +=1
        else:
            num = 1
            before = p

        print(str(p).zfill(6) + str(num).zfill(6))



if __name__ == "__main__":
    main()


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

def main():
    N, M =  [int(i) for i in input().split()]
    cities = []

    for i in range(M):
        p, y = map(int, input().split())
        cities.append([p, y, i])

    cities.sort()
    ans = []

    num = 0
    before = cities[0][0]

    for i in range(M):
        if before != cities[i][0]:
            num = 1
            before = cities[i][0]
        else:
            num += 1
        ans.append([cities[i][0], num, cities[i][2]])

    ans.sort(key=lambda x:x[2])
    for a in ans:
        s = str(a[0]).zfill(6) + str(a[1]).zfill(6)
        print(s)



if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
from operator import itemgetter
n,m = map(int,input().split())
py = [list(map(int,input().split())) for _ in range(m)]
copy = py
sorted(py, key=itemgetter(1))
a = [1]*n
b = [0]*m
for i in range(m):
  b[i] = a[py[i][0]-1]
  a[py[i][0]-1] += 1
for j in range(m):
  x = py.index(copy[j])
  print(1000000*copy[j][0]+b[x])
  
  
  


n,m = map(int,input().split())
a = [[] for _ in range(n)]
for i in range(1,m+1):
  pi,yi = map(int,input().split())
  a[pi-1].append((yi,i))
ans = [0 for _ in range(m)]
for i in range(n):
  if a[i]:
    a[i].sort(key=lambda x:x[0])
    c = (i+1)*10**6
    for j in range(len(a[i])):
      ans[a[i][j][1]-1] = c + j+1
for xx in ans:
  xs = str(xx)
  xs = "0"*(12-len(xs)) + xs
  print(xs)
  


  

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
import bisect

n, m = map(int, input().split())
py_dict = {}
cityi_by_year = []
for i in range(m):
  p, y = map(int, input().split())
  if p not in py_dict:py_dict[p] = [y]
  else:py_dict[p].append(y)
  cityi_by_year.append([p,y])

for p, y in cityi_by_year:
  idx = bisect.bisect_left(py_dict[p],y)
  print('0'*(6-len(str(p))) + str(p) + '0'*(6-len(str(idx+1))) + str(idx+1))


import collections
import bisect
n,m=map(int,input().split())
p=[[int(j) for j in input().split()] for i in range(m)]
a=collections.defaultdict(list)
for x,y in sorted(p):
    a[x]+=[y]
for x,y in p:
    z=bisect.bisect(a[x],y)
    print("%06d%06d"%(x,z))

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n, m = map(int, input().split())
py = [[i, list(map(int, input().split()))] for i in range(m)]

py = sorted(py, key=lambda x: (x[1][0],x[1][1]))
print(py)

cnt = 1
prev_p = 0
for i in py:
    p, y = i[1][0], i[1][1]
    if prev_p == p:
        cnt += 1
    else:
        cnt = 1

    ans = str(p).zfill(6) + str(cnt).zfill(6)
    i.append(ans)
    prev_p = p

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

n, m = map(int, input().split())
pyidx = []
for i in range(m):
    py_tmp = list(map(int, (input()).split() + [str(i)]))
    pyidx += [py_tmp]

pyidx = sorted(pyidx, key=lambda x: x[1])

counter = [1] * n

ans = []
for i, pyx in enumerate(pyidx):
    p, y, idx = pyx[0], pyx[1], pyx[2]
    x_new = counter[p-1]
    counter[p-1] += 1
    ans.append([str(p).zfill(6) + str(x_new).zfill(6), idx])

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

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
"""



"""

N, M = map(int, input().split())

city = [list(map(int, input().split())) + [i] + [0] for i in range(M)]

city.sort(key=lambda x: (x[0], x[1]))
print(city)
for m in range(M):
    if m == 0:
        city[m][3] = 1
    elif city[m][0] != city[m - 1][0]:
        city[m][3] = 1
    else:
        city[m][3] = city[m - 1][3] + 1

city.sort(key=lambda x: x[2])

for m in range(M):
    print(str(city[m][0]).zfill(6) + str(city[m][3]).zfill(6))
    

"""



"""

N, M = map(int, input().split())

city = [list(map(int, input().split())) + [i] + [0] for i in range(M)]

city.sort(key=lambda x: (x[0], x[1]))

for m in range(M):
    if m == 0:
        city[m][3] = 1
    elif city[m][0] != city[m - 1][0]:
        city[m][3] = 1
    else:
        city[m][3] = city[m - 1][3] + 1

city.sort(key=lambda x: x[2])

for m in range(M):
    print(str(city[m][0]).zfill(6) + str(city[m][3]).zfill(6))
    

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
N, M = map(int, input().split())
pref = [[] for _ in range(N)]
P,Y = [0]*M,[0]*M
for i in range(M):
    P[i],Y[i] = map(int, input().split())
    pref[P[i]-1].append(Y[i])

for i in range(N):
    pref[i].sort()

from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort

def solve(P,Y,pref):
    ans = []
    for p, y in zip(P,Y):
        ind = bisect_left(Y,y)+1
        num = '0'*(6-len(str(p)))+str(p)+'0'*(6-len(str(ind)))+str(ind)
        ans.append(num)
    return ans
print(*solve(P,Y,pref),sep='\n')

N, M = map(int, input().split())
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
def solve(N,M):
    pref = [[] for _ in range(N)]
    P = [0]*M
    Y = [0]*M
    for i in range(M):
        P[i],Y[i] = map(int, input().split())
        pref[P[i]-1].append(Y[i])
    for i in range(N):
        pref[i].sort()
    ans = []
    for i in range(M):
        ind = bisect_left(pref[P[i]-1],Y[i])
        ans.append('0'*(6-len(str(P[i])))+str(P[i])+'0'*(6-len(str(ind+1)))+str(ind+1))
    return ans
print(*solve(N,M),sep='\n')


Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n, m = map(int, input().split())
l = [list(map(int, input().split(' '))) for _ in range(m)]
l = sorted(l)
#print(n,m)
#print(l)

x = l[0][0]
y = 1
#print(x)

for i in range(m):
    if l[i][0] == x:
        l[i][1] = y
        y += 1
    else:
        y = 1
        l[i][1] = y
        y += 1
        x = l[i][0]
#print(l)

for j in range(m):
    print(str(l[j][0]).rjust(6,'0') + str(l[j][1]).rjust(6,'0'))


n, m = map(int, input().split())
l = [list(map(int, input().split(' '))) for _ in range(m)]
#print(l)
l = sorted(l)
#print(n,m)
#print(l)

x = l[0][0]
y = 1
#print(x)

for i in range(m):
    if l[i][0] == x:
        l[i][1] = y
        y += 1
    else:
        y = 1
        l[i][1] = y
        y += 1
        x = l[i][0]
#print(l)
l = sorted(l, key=lambda x:(x[1]))
#print(l)
#l = list(reversed(l))
#print(l)
z = []
for j in range(m):
    z.append(str(l[j][0]).rjust(6,'0') + str(l[j][1]).rjust(6,'0'))
#z.sort()
for k in range(m):
    print(z[k])

n, m = map(int, input().split())
l = [list(map(int, input().split(' '))) for _ in range(m)]

for v in range(m):
    l[v].append(v)

l = sorted(l)


x = l[0][0]
y = 1

for i in range(m):
    if l[i][0] == x:
        l[i][1] = y
        y += 1
    else:
        y = 1
        l[i][1] = y
        y += 1
        x = l[i][0]

l = sorted(l, key=lambda i:(i[2]))

z = []
for j in range(m):
    z.append(str(l[j][0]).rjust(6,'0') + str(l[j][1]).rjust(6,'0'))

for k in range(m):
    print(z[k])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
# coding: UTF-8
import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n, m = map(int, input().split())
p = defaultdict(lambda :defaultdict(int))
e = [[int(i) for i in input().split()] for i in range(m)] 
p_index = [0] * (100001)
for i in e:
    pp, yy = i[0], i[1]
    p_index[pp] += 1
    p[pp][yy] = p_index[pp]

for i in e:
    print("{:0=6}".format(i[0]) + "{:0=6}".format(p[i[0]][i[1]]))

# coding: UTF-8
import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n, m = map(int, input().split())
p = defaultdict(lambda :defaultdict(list))
e = [[int(i) for i in input().split()] for i in range(m)] 
p_index = defaultdict(int)
for i in e:
    pp, yy = i[0], i[1]
    p[pp][yy] = 0

for i in p:
    count = 0
    l = sorted(p[i])
    for j in l:
        count += 1
        p[i][j] += count

for i in e:
    print("{:0=6}".format(i[0]) + "{:0=6}".format(p[i[0]][i[1]]))

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
import numpy as np
N,M = map(int,input().split())
data=[]
for i in range(M):
    data.append(list(map(int,input().split(" "))))

arr = np.array(data)
c1=np.arange(0,M)
arr=np.insert(arr,2,c1,axis=1)
#arr_sort=arr[np.argsort(arr[:,0])]
arr_sort=arr[np.argsort(arr[:,1])]
arr_sort=arr_sort[np.argsort(arr_sort[:,0])]

j=1
i_prev=1
res=[]
k = 0
for i in arr_sort:
    if(int(i[0])!=i_prev):
        j=1
    #print("{:06}{:06}".format(i[0],j))
    test = "{:06}{:06}".format(i[0],j)
    arr_sort[k][1]= str(test)
    k+=1
    j+=1
    i_prev=i[0]

arr_sort=arr_sort[np.argsort(arr_sort[:,0])]
for i in arr_sort:
    print("{:012}".format(i[1]))

import numpy as np
N, M = map(int, input().split())
p_dict = {}
p = [0 for i in range(M)]
y = [0 for i in range(M)]
i_in_p = [0 for i in range(M)]
 
for i in range(M):
    p[i], y[i] = map(int, input().split())
    if p[i] not in p_dict:
        i_in_p[i] = 0
        p_dict[p[i]] = [y[i]]
        continue
    i_in_p[i] = len(p_dict[p[i]])
    p_dict[p[i]].append(y[i])
for key in p_dict.keys():
    p_dict[key] = np.array(p_dict[key]).argsort().argsort() + 1
for i in range(M):
    print('{:06d}{:06d}'.format(p[i], p_dict[p[i]][i_in_p[i]]))

Verdicts: Wrong Answer

Accepted
Problem: In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.  City i is established in year Y_i and belongs to Prefecture P_i.  You can assume that there are no multiple cities that are established in the same year.  It is decided to allocate a 12-digit ID number to each city.  If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.  Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.  Find the ID numbers for all the cities.  Note that there can be a prefecture with no cities.

Submission attempts (in order):
n,m=map(int, input().split())
pl=[0]*m
yl=[0]*m
cl=[0]*m
ppl=[[] for j in range(n+1)]
for i in range(m):
    pl[i],yl[i] = map(int, input().split())
    ppl[pl[i]].append((yl[i], i))

for i in range(m):
    print("%06d%06d" % (pl[i], cl[i]))

n,m=map(int, input().split())
pl=[0]*m
yl=[0]*m
cl=[0]*m
# ppl=[[] for j in range(n+1)]
for i in range(m):
    pl[i],yl[i] = map(int, input().split())


#     pl[i],yl[i] = map(int, input().split())
#     ppl[pl[i]].append((yl[i], i))

for i in range(m):
    print("%06d%06d" % (pl[i], cl[i]))

import bisect
n,m=map(int, input().split())
pl=[0]*100000
yl=[0]*100000
ol=[[] for i in range(100001)]
for i in range(m):
    pl[i],yl[i] = map(int, input().split())
    ol[pl[i]].append(yl[i])
for i in range(1,n+1):
    ol[i].sort()
for i in range(m):
    print("%06d%06d" % (pl[i], bisect.bisect_right(ol[pl[i]], yl[i])))

Verdicts: Wrong Answer

Wrong Answer

Accepted