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 = input().split()
plist = []
ylist = []
n = int(n)
m = int(m)
anslist = [0 for i in range(m)]
list = [[] for i in range(n+1)]
for i in range(m):
    p,y = input().split()
    p = int(p)
    y = int(y)
    plist.append(p)
    ylist.append(y)
for i in range(m):
    for j in range(n+1):
        if plist[i] == j + 1:
            list[j].append([ylist[i],i])
for i in range(n):
    list[i].sort()
for i in range(n):
    for j in range(len(list[i])):
        mtem = list[i][j][1]
        ans1 = str(plist[mtem])
        while len(ans1) <= 6:
            ans1 = "0" + ans1
        ans2 = str(j+1)
        while len(ans2) <= 6:
            ans2 = "0" + ans2
        anslist[mtem] = ans1 + ans2
for i in range(m):
    print(anslist[i])

n,m = input().split()
plist = []
ylist = []
n = int(n)
m = int(m)
anslist = [0 for i in range(m)]
list = [[] for i in range(n+1)]
for i in range(m):
    p,y = input().split()
    p = int(p)
    y = int(y)
    plist.append(p)
    ylist.append(y)
    list[p-1].append([ylist[i],i])
for i in range(n):
    list[i].sort()
    for j in range(len(list[i])):
        mtem = list[i][j][1]
        ans1 = str(plist[mtem])
        while len(ans1) < 6:
            ans1 = "0" + ans1
        ans2 = str(j+1)
        while len(ans2) < 6:
            ans2 = "0" + ans2
        anslist[mtem] = ans1 + ans2
for i in range(m):
    print(anslist[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())
ls = []
for i in range(m):
    p,y = map(int,input().split())
    ls.append([p,y])
ls.sort(key= lambda x:x[1])
ls.sort(key= lambda x:x[0])
pre = ls[0][0]
cnt = 1
for p,y in ls:
    if p==pre:
        print(str(p).zfill(6) + str(cnt).zfill(6))
        cnt+=1
    else:
        pre = p
        print(str(p).zfill(6) + str(1).zfill(6))
        cnt=2


n,m = map(int,input().split())
ls = []
for i in range(m):
    p,y = map(int,input().split())
    ls.append([p,y,i])
ls.sort(key= lambda x:x[1])
ls.sort(key= lambda x:x[0])
pre = ls[0][0]
cnt = 1
ans = []
for p,y,i in ls:
    if p==pre:
        ans.append(   (str(p).zfill(6) + str(cnt).zfill(6) ,i))
        cnt+=1
    else:
        pre = p
        ans.append((str(p).zfill(6) + str(1).zfill(6),i))
        cnt=2
ans.sort(key=lambda x:x[1])
for a,i in ans:
    print(a)


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) = list(map(int, input().split()))

py = []

for i in range(m):
    py.append(input().split())

mapa ={}

for i in range(m):
    if py[i][0] in mapa:
        mapa[py[i][0]][py[i][1]] = i
    else:
        mapa[py[i][0]] = {py[i][1]:i}

ans = ['' for _ in range(m)]

for i in mapa:
    pri = mapa[i]
    pri = sorted(pri.items())
    for j in range(len(pri)):
        ans[pri[j][1]] = ('00000' + i)[-5:] + ('00000' + str(j + 1))[-5:]
for i in ans:
    print(i)

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

py = []

for i in range(m):
    py.append(list(map(int, input().split())))

mapa ={}

for i in range(m):
    if py[i][0] in mapa:
        mapa[py[i][0]][py[i][1]] = i
    else:
        mapa[py[i][0]] = {py[i][1]:i}

ans = ['' for _ in range(m)]

for i in mapa:
    pri = mapa[i]
    pri = sorted(pri.items())
    print(pri)
    for j in range(len(pri)):
        ans[pri[j][1]] = ('000000' + str(i))[-6:] + ('000000' + str(j + 1))[-6:]
for i in ans:
    print(i)

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

py = []

for i in range(m):
    py.append(list(map(int, input().split())))

mapa ={}

for i in range(m):
    if py[i][0] in mapa:
        mapa[py[i][0]][py[i][1]] = i
    else:
        mapa[py[i][0]] = {py[i][1]:i}

ans = ['' for _ in range(m)]

for i in mapa:
    pri = mapa[i]
    pri = sorted(pri.items())
    for j in range(len(pri)):
        ans[pri[j][1]] = ('000000' + str(i))[-6:] + ('000000' + str(j + 1))[-6:]
for i in ans:
    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 = list(map(int, input().split()))
info = [list(map(int, input().split())) for i in range(m)]

pref = {}
for p,y in info:
    if not p in pref: pref[p] = [y]
    else: pref[p].append(y)

id = {}
for p,years in pref.items():
    id[p] = {}
    for i,y in enumerate(years):
        id[p][y] = str(p).zfill(6) + str(i+1).zfill(6)

for p,y in info:
    print(id[p][y])

import numpy as np
n,m = list(map(int, input().split()))
info = [list(map(int, input().split())) for i in range(m)]

info = np.array(info)
pref = {}
for i in range(1,n+1):
    pref[i] = info[info[:,0] == i, 1]

id = {}
for p,years in pref.items():
    id[p] = {}
    for i,y in enumerate(years):
        id[p][y] = str(p).zfill(6) + str(i+1).zfill(6)

for p,y in info:
    print(id[p][y])

n,m = list(map(int, input().split()))
info = [list(map(int, input().split())) for i in range(m)]

pref = {}
for p,y in info:
    if not p in pref: pref[p] = [y]
    else: pref[p].append(y)

id = {}
for p,years in pref.items():
    years.sort()
    id[p] = {}
    for i,y in enumerate(years):
        id[p][y] = str(p).zfill(6) + str(i+1).zfill(6)

for p,y in info:
    print(id[p][y])

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())
py = [[list(map(int, input().split()))] + [i] for i in range(m)]
py.sort(key=lambda x: [x[0], x[1]])
ans = []
P = [0] * (n + 1)
for p, y, i in py:
    P[p] += 1
    tmp = str(p).zfill(6) + str(P[p]).zfill(6)
    ans.append([i,tmp])
ans.sort()
for i,a in ans:
    print(a)

n,m = map(int, input().split())
py = [list(map(int, input().split())) + [i] for i in range(m)]
py.sort(key=lambda x: [x[0], x[1]])
ans = []
P = [0] * (n + 1)
for p, y, i in py:
    P[p] += 1
    tmp = str(p).zfill(6) + str(P[p]).zfill(6)
    ans.append([i,tmp])
ans.sort()
for i,a in ans:
    print(a)

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):
import bisect
n,m = map(int,input().split())

l1 = [[] for i in range(n)]
l2 = []

for i in range(m):
    p,y = map(int,input().split())
    l1[p-1].append(y)
    l2.append((p,y))

for p in range(n):
    l1[p].sort()

for i in range(m):
    p = l2[i][0]
    k = bisect.right(l1[p-1],l2[i][1])
    p = str(p)
    k = str(k)
    ans = "0"*(6-len(p))+p+"0"*(6-len(k))+k
    print(ans)


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

l1 = [[] for i in range(n)]
l2 = []

for i in range(m):
    p,y = map(int,input().split())
    l1[p-1].append(y)
    l2.append((p,y))

for p in range(n):
    l1[p].sort()

for i in range(m):
    p = l2[i][0]
    k = bisect.bisect_right(l1[p-1],l2[i][1])
    p = str(p)
    k = str(k)
    ans = "0"*(6-len(p))+p+"0"*(6-len(k))+k
    print(ans)

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())

shi_map = []

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

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

result = {}
shi_count = {}
for i, p, y in shi_map:

    if p in shi_count:
        c = shi_count[p]
        count = c + 1
        shi_count[p] = count
    else:
        shi_count[p] = 1
        count = 1
    result[i] = [p, count]
result = list(sorted(result.items(), key=lambda x: x[0]))

for i, p in result:

    p2 = str(p[0]).zfill(6)

    y = str(p[1]).zfill(6)
    r = p2+y
    print(r)

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

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

ans = {}

ken = -1
cnt = 1
for item in items:
    if item[0] != ken:
        cnt = 1
        ans[item[2]] = str(item[0]).zfill(6) + str(cnt).zfill(6)
        ken = item[0]
    else:
        cnt += 1
        ans[item[2]] = str(item[0]).zfill(6) + str(cnt).zfill(6)

for i in range(M):
    print(ans[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())
P_Y_list = np.array([input().split() for _ in range(0, M)], dtype='int')
years = [np.sort(P_Y_list[np.where(P_Y_list[:,0]==i)][:,1]) for i in set(P_Y_list[:, 0])]
for l in P_Y_list:
    left = str(l[0]).zfill(6)
    right = str(np.where(years[list(set(P_Y_list[:,0])).index(l[0])]==l[1])[0][0]+1).zfill(6)
    print(left+right)

import numpy as np
N, M = map(int,input().split())
P_Y_list = np.array([input().split() for _ in range(0, M)], dtype='int')
counts = (np.zeros(N+1)).astype(int)
id_list = []

sort_ind = np.argsort(P_Y_list[:,1])
sorted_P_Y = P_Y_list[sort_ind]

for p, y in sorted_P_Y:
    counts[p] += 1
    id_list.append(str(p).zfill(6) + str(counts[p]).zfill(6))
id_list = np.array(id_list)
id_list = id_list[np.argsort(sort_ind)]
for id in id_list:
    print(id)

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())

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

print(city)

out = [0]*M
cnt = 1
for i in range(len(city)):
	out[city[i][2]] = '{0:06d}{1:06d}'.format(city[i][0], cnt)
	try:
		if city[i+1][0] == city[i][0]: cnt += 1
		else: cnt = 1
	except(IndexError):
		cnt += 1

for o in out:
	print(o)
	

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

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

out = [0]*M
cnt = 1
for i in range(len(city)):
	out[city[i][2]] = '{0:06d}{1:06d}'.format(city[i][0], cnt)
	try:
		if city[i+1][0] == city[i][0]: cnt += 1
		else: cnt = 1
	except(IndexError):
		cnt += 1

for o in out:
	print(o)
	

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()))]
l=[1]*n
for i in range(m):
    py[i].append(i+1)
py.sort()
for i in range(m):
    py[i].append( str(py[i][0]).zfill(6) + str(l[py[i][0]-1]).zfill(6))
    l[py[i][0]-1]+=1
py.sort(key=lambda x:x[2])
for i in range(m):
    print(py[i][-1])

n,m=map(int,input().split())
py=[list(map(int,input().split())) for _ in range(m)]
l=[1]*n
for i in range(m):
    py[i].append(i+1)
py.sort()
for i in range(m):
    py[i].append( str(py[i][0]).zfill(6) + str(l[py[i][0]-1]).zfill(6))
    l[py[i][0]-1]+=1
py.sort(key=lambda x:x[2])
for i in range(m):
    print(py[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):
import sys

input = sys.stdin.readline
N,M = map(int,input().split())
PY = {n: [] for n in range(N + 1)}
for i in range(M):
  p,y = map(int,input().split())
  PY[p].append((y, i))
print(PY)
for p,y in PY.items():
  y.sort()
  for j, (z, i) in enumerate(y):
    top_number = '0'*(6-len(str(p)))+str(p)
    under_number = '0'*(6-len((str(j+1))))+str(j+1)
    print(top_number + under_number)

import sys

input = sys.stdin.readline
N,M = map(int,input().split())
PY = {n: [] for n in range(N + 1)}
ans = [0]*M
for i in range(M):
  p,y = map(int,input().split())
  PY[p].append((y, i))
print(PY)
for p,y in PY.items():
  y.sort()
  for j, (z, i) in enumerate(y):
    top_number = '0'*(6-len(str(p)))+str(p)
    under_number = '0'*(6-len((str(j+1))))+str(j+1)
    ans[i] = top_number + under_number
for i in range(M):
  print(ans[i])

N,M = map(int,input().split())
PY = {n: [] for n in range(N + 1)}
ans = [0]*M
for i in range(M):
  p,y = map(int,input().split())
  PY[p].append((y, i))
for p,y in PY.items():
  y.sort()
  for j, (z, i) in enumerate(y):
    top_number = '0'*(6-len(str(p)))+str(p)
    under_number = '0'*(6-len((str(j+1))))+str(j+1)
    ans[i] = top_number + under_number
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):
def get_line():
  return input().split(' ')

class element:
  def __init__(self, P, Y, idx):
    self.P = P
    self.Y = Y
    self.idx = idx
  def __lt__(self, other):
    return self.Y < other.Y

N, M = map(int, get_line())
els = [0] * M
for i in range(M):
  p, y = map(int, get_line())
  els[i] = Element(p, y, i)

p_map = [[] for _ in range(N)]

for e in els:
  p_map[e.P - 1].append(e)

ans = [0] * M

for mp in p_map:
  cnt = 1
  for e in sorted(mp):
    ans[e.idx] = "{:06d}{:06d}".format(e.P, cnt)
    cnt = cnt + 1

for e in ans:
  print(e)


def get_line():
  return input().split(' ')

class element:
  def __init__(self, P, Y, idx):
    self.P = P
    self.Y = Y
    self.idx = idx
  def __lt__(self, other):
    return self.Y < other.Y

N, M = map(int, get_line())
els = [0] * M
for i in range(M):
  p, y = map(int, get_line())
  els[i] = element(p, y, i)

p_map = [[] for _ in range(N)]

for e in els:
  p_map[e.P - 1].append(e)

ans = [0] * M

for mp in p_map:
  cnt = 1
  for e in sorted(mp):
    ans[e.idx] = "{:06d}{:06d}".format(e.P, cnt)
    cnt = cnt + 1

for e in ans:
  print(e)


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):
def year(x):
    return Y[x]

N, M = [int(s) for s in input().rstrip().split()]
P = []
Y = []
for m in range(M):
    input_line = [int(s) for s in input().rstrip().split()]
    P.append(input_line[0])
    Y.append(input_line[1])

pref = [[] for _ in range(N)]
for m in range(M):
    pref[P[m]-1].append(m)

for n in range(N):
    pref[n].sort(key = year)
    
id = []
for m in range(M):
    str1 = '{0:06d}'.format(P[m])
    for i in range(len(pref[P[m]-1])):
        if i == m:
            str2 = '{0:06d}'.format(i+1)
    id.append(str1 + str2)

for m in range(M):
    print(id[m])

def year(x):
    return Y[x]

N, M = [int(s) for s in input().rstrip().split()]
P = []
Y = []
for m in range(M):
    input_line = [int(s) for s in input().rstrip().split()]
    P.append(input_line[0])
    Y.append(input_line[1])

pref = [[] for _ in range(N)]
for m in range(M):
    pref[P[m]-1].append(m)

for n in range(N):
    if pref[n]:
        pref[n].sort(key = year)
    
id = []
for m in range(M):
    str1 = '{0:06d}'.format(P[m])
    for i in range(len(pref[P[m]-1])):
        if i == m:
            str2 = '{0:06d}'.format(i+1)
    id.append(str1 + str2)

for m in range(M):
    print(id[m])

N, M = [int(s) for s in input().rstrip().split()]
pref = [[] for _ in range(N)]
P = []
for m in range(M):
    p, year = [int(s) for s in input().rstrip().split()]
    pref[p-1].append([year, m])
    P.append(p)

id = [None] * M
for n, p in enumerate(pref):
    if not p:
        continue    
    p.sort()
    for x, (year, m) in enumerate(p):
        id[m] = '{0:06d}{1:06d}'.format(n+1, x+1)

print('\n'.join(id))


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())

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


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


for prefecture, cities in enumerate(prefectures):
    if cities == []:
        continue
    else:
        cities.sort()
    
    for x, city in enumerate(cities):
        temp = '{0:06d}'.format(prefecture+1)
        temp = temp + '{0:06d}'.format(x+1)
        print(temp)


N, M = map(int, input().split())
temp = [list(map(int, input().split())) for i in range(M)]
cities = []
for x, city in enumerate(temp):
    cities.append([x+1, city[0], city[1]])
#  print(cities)
#  [[1, 1, 32], [2, 2, 63], [3, 1, 12]]



prefectures = [[] for i in range(N)]
for city in cities:
    prefectures[city[1]-1].append(city)

#  [[[1, 1, 32], [3, 1, 12]], [[2, 2, 63]]]

ID_list = []

for prefecture in prefectures:
    prefecture.sort(key=lambda x:x[2])
    
    #  [[3, 1, 12], [1, 1, 32]]
    #  [[2, 2, 63]]
    for x, city in enumerate(prefecture):
        ID_list.append([city[0], city[1], x+1])

ID_list.sort()
#  print(ID_list)
#  [[1, 1, 2], [2, 2, 1], [3, 1, 1]]



for ID in ID_list:
    temp = '{0:06d}'.format(ID[1])
    temp = temp + '{0:06d}'.format(ID[2])
    print(temp)





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 sys
input=sys.stdin.readline
 
N,M = map(int, input().split())
 
pref = [[0] for i in range(N+1)]
import collections
q = collections.deque()
 
for i in range(M):
    p,y = map(int, input().split())
    pref[p].append(y)
    q.append((p,y))
for p in pref:
    p.sort()
 
print(q)
import bisect
for p,y in q:
    print(p,y)
    print("%06d%06d" %(p, bisect.bisect_left(pref[p], y)))

import sys
input=sys.stdin.readline
 
N,M = map(int, input().split())
 
pref = [[0] for i in range(N+1)]
import collections
q = collections.deque()
 
for i in range(M):
    p,y = map(int, input().split())
    pref[p].append(y)
    q.append((p,y))
for p in pref:
    p.sort()
 
import bisect
for p,y in q:
    print("%06d%06d" %(p, bisect.bisect_left(pref[p], y)))

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())

counts = defaultdict(int)
numbers = {}

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

sorted_cities = sorted(cities, key=lambda x: x[2])
for city in sorted_cities:
    i, p, y = city
    counts[p] += 1
    numbers[i] = '{:06}{:06}'.format(p, counts[p])

for city in cities:
    print(numbers[city[0]])

from collections import defaultdict
N, M = map(int, input().split())

counts = defaultdict(int)
numbers = {}

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

sorted_cities = sorted(cities, key=lambda x: x[2])
for city in sorted_cities:
    i, p, y = city
    counts[p] += 1
    numbers[i] = '{:06}{:06}'.format(p, counts[p])

for city in cities:
    print(numbers[city[0]])

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 collections import defaultdict
n,m = list(map(int, input().split()))
cities = defaultdict(list)
cities = [ list(map(int, input().split())) for _ in range(m)]
sorted = sorted(
  cities,
  key = lambda x: (x[0], x[1])
)
hoge = 0
first_code = 0
fuga = 0
second_code = 0
for city in sorted:
  if(hoge < city[0]):
    hoge = city[0]
    first_code += 1
    fuga = 0
    seconde_code = 0
  if(fuga < city[1]):
    fuga = city[1]
    seconde_code += 1    
  print(format(first_code, '06'), format(second_code, '06'),sep="")

from collections import defaultdict
n,m = list(map(int, input().split()))
cities = defaultdict(list)
cities = [ list(map(int, input().split())) for _ in range(m)]
sorted = sorted(
  cities,
  key = lambda x: (x[0], x[1])
)
hoge = 0
first_code = 0
fuga = 0
second_code = 0
for city in sorted:
  if(hoge < city[0]):
    hoge = city[0]
    first_code += 1
    fuga = 0
    second_code = 0
  if(fuga < city[1]):
    fuga = city[1]
    second_code += 1    
  print(format(first_code, '06'), format(second_code, '06'),sep="")

n,m = list(map(int, input().split()))
cities = defaultdict(list)
cities = [ list(map(int, input().split())) for _ in range(m)]
sorted = sorted(
  cities,
  key = lambda x: (x[0], x[1])
)
hoge = 0
first_code = 0
fuga = 0
second_code = 0
for city in sorted:
  if(hoge < city[0]):
    hoge = city[0]
    first_code += 1
    fuga = 0
    seconde_code = 0
  if(fuga < city[1]):
    fuga = city[1]
    seconde_code += 1    
  print(format(first_code, '06'), format(second_code, '06'),sep="")

from collections import defaultdict
import heapq
n_pref, m_city = list(map(int, input().split()))
record = defaultdict(list)
cities = []
for i in range(m_city):
  pref, year = list(map(int, input().split()))
  cities.append({"pref": pref, "year": year})
  heapq.heappush(record[pref], year)
res = defaultdict(dict)
for key ,value in record.items():
  for i in range(1, len(value) + 1):
    res[key][heapq.heappop(value)] = i
for city in cities:
  print(format(city["pref"], '06d'), format(res[city["pref"]][city["year"]], '06d'), sep="")

Verdicts: Wrong Answer

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())

P = [0]*M
Y = [0]*M

for i in range(M):
    p,y = map(int,input().split())
    P.append(p)
    Y.append(y)

A = [0]*M
C = [0]*M

B = [0]*M
for i in range(M):
    B[i] = Y[i]*100000+i

B.sort()

for i in range(M):
    d = B[i] % 100000
    k = P[d] - 1

    C[d] = A[k]
    A[k] += 1

for i in range(M):
    print('%06d%06d' % (P[i],C[i]+1))


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

P = [0]*M
Y = [0]*M

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

A = [0]*M
C = [0]*M

B = [0]*M
for i in range(M):
    B[i] = Y[i]*100000+i

B.sort()

for i in range(M):
    d = B[i] % 100000
    k = P[d] - 1

    C[d] = A[k]
    A[k] += 1

for i in range(M):
    print('%06d%06d' % (P[i],C[i]+1))


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

P = [0]*M
Y = [0]*M

for i in range(M):
    P[i],Y[i] = map(int,input().split())

A = [0]*N
C = [0]*M

B = [0]*M
for i in range(M):
    B[i] = Y[i]*100000+i

B.sort()

for i in range(M):
    d = B[i] % 100000
    k = P[d] - 1

    C[d] = A[k]
    A[k] += 1

for i in range(M):
    print('%06d%06d' % (P[i],C[i]+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 = (int(x) for x in input().split())
l = []
for _ in range(m):
    l.append([int(x) for x in input().split()])
d = {}
for i in range(m):
    k = str(l[i][0])
    if k not in d.keys():
        d[k] = 1
    else:
        d[k] += 1
    print(k.zfill(6) + str(d[k]).zfill(6))

import bisect as bis
n, m = map(int, input().split())
p, y = [], []
idx = lambda x: x-1
for _ in range(m):
    p_, y_ = map(int, input().split())
    p.append(p_)
    y.append(y_)
val = [[] for _ in range(n)]
for i in range(m):
    val[idx(p[i])].append(y[i])
for i in range(n):
    val[i].sort()
for i in range(m):
    v = p[i]
    id = bis.bisect_right(val[idx(v)], y[i])
    print(str(v).zfill(6) + str(id).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 = (int(x) for x in input().split())

p_y_list = []
y_count = [1]*(M+1)

for i in range(M):
    p_y_list.append([int(x) for x in input().split()])
    p_y_list[i].append(i)
p_y_list.sort(key = lambda x:x[1])

for i in p_y_list:
    i[1] = y_count[i[0]]
    y_count[i[0]] += 1

p_y_list.sort(key = lambda x:x[2])
for i in p_y_id_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))

N,M = (int(x) for x in input().split())

p_y_list = [0]*N
y_count = [1]*(M+1)

for i in range(N):
    p,y = (int(x) for x in input().split())
    p_y_list[i] = [p,y,i]
p_y_list.sort(key = lambda x:x[1])

for i in p_y_list:
    i[1] = y_count[i[0]]
    y_count[i[0]] += 1

p_y_list.sort(key = lambda x:x[2])
for i in p_y_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))

N,M = (int(x) for x in input().split())

p_y_list = []
y_count = [1]*(M+1)

for i in range(M):
    p,y = (int(x) for x in input().split())
    p_y_list[i] = [p,y,i]
p_y_list.sort(key = lambda x:x[1])

for i in p_y_list:
    i[1] = y_count[i[0]]
    y_count[i[0]] += 1

p_y_list.sort(key = lambda x:x[2])
for i in p_y_id_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))

N,M = (int(x) for x in input().split())

p_y_list = []

for i in range(M):
    p_y_list.append(tuple(int(x) for x in input().split()))
p_y_list.sort(key = lambda x:x[1])
p_y_list.sort(key = lambda x:x[0])

p_y_id_list = []
p = p_y_list[0][0]
y_c = 1
for i in p_y_list:
    if i[0] == p:
        p_y_id_list.append((i[0],y_c))
        y_c += 1
    else:
        p = i[0]
        y_c = 1
        p_y_id_list.append((i[0],y_c))

p_y_id_list.sort(key = lambda x:x[1] , reverse =True)
p_y_id_list.sort(key = lambda x:x[0] , reverse =True)
for i in p_y_id_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))

N,M = (int(x) for x in input().split())

p_y_list = [0]*M
y_count = [1]*(N+1)

for i in range(M):
    p,y = (int(x) for x in input().split())
    p_y_list[i] = [p,y,i]
p_y_list.sort(key = lambda x:x[1])

for i in p_y_list:
    i[1] = y_count[i[0]]
    y_count[i[0]] += 1

p_y_list.sort(key = lambda x:x[2])
for i in p_y_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))

Verdicts: Runtime Error

Runtime Error

Runtime Error

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):
ken_num, city_num = map(int,input().split())
city_list = [None for _ in range(city_num)]
ken_list = [1 for _ in range(ken_num+1)]
id_list = [None for _ in range(city_num)]
for index in range(city_num):
    city_list[index] = list(map(int,input().split()))
    city_list[index].append(index)
city_list = sorted(city_list, key=lambda x: x[1])

for index,city in enumerate(city_list):
    id_list[city[2]] = str(city[0]).zfill(6) + str(ken_list[city[0]]).zfill(6)
    ken_list[city[0]] += 1

print(id_list)

ken_num, city_num = map(int,input().split())
city_list = [None for _ in range(city_num)]
ken_list = [1 for _ in range(ken_num+1)]
id_list = [None for _ in range(city_num)]
for index in range(city_num):
    city_list[index] = list(map(int,input().split()))
    city_list[index].append(index)
city_list = sorted(city_list, key=lambda x: x[1])

for index,city in enumerate(city_list):
    id_list[city[2]] = str(city[0]).zfill(6) + str(ken_list[city[0]]).zfill(6)
    ken_list[city[0]] += 1

for ans in id_list:
    print(ans)

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):
Data = list(map(int, input().split()))
N = Data[0]
M = Data[1]
del(Data)
Data = []
for i in range(M):
  Data.append(list(map(int, input().split())))
Data.sort()
Cnt = 0
Num = 0
Str = ""
for i in range(M):
  if Num == Data[i][0]:
    Cnt += 1
  else:
    Cnt = 1
    Num = Data[i][0]
  Str = format(Num, '06x') + format(Cnt, '06x')
  print(Str)

Data = list(map(int, input().split()))
N = Data[0]
M = Data[1]
del(Data)
Data = []
for i in range(M):
  Data.append(list(map(int, input().split())))
  Data[i].append(i)
Data.sort()
Cnt = 0
Num = 0
for i in range(M):
  if Num == Data[i][0]:
    Cnt += 1
  else:
    Cnt = 1
    Num = Data[i][0]
  Data[i].append(Cnt)
Data.sort(key=lambda x:x[2])

for i in range(M):
  print(str(Data[i][0]).zfill(6) + str(Data[i][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=[int(i) for i in input().split()]
P=[[int(i) for i in input().split()] for j in range(m)]

def prefecturesort(i):
    return i[0]

def yearsort(i):
    return i[1]

W=[0 for i in range(n)]
Z=[]

for i in range(m):
    P[i].append(i)
    W[P[i][0]]+=1

P.sort(key=prefecturesort)
P_c=[]
sum=0
for i in range(n):
    c=W[i]
    if c==0:
        P_c.append([])
    else:
        P_c.append(P[sum:c+sum])
    sum+=c
    P_c[i].sort(key=yearsort)
for x in P_c:
    for j in range(len(x)):
        X=str("{0:06d}".format(x[j][0]))
        Y=str("{0:06d}".format(j+1))
        Z.append([X+Y,x[j][2]])
Z.sort(key=yearsort)
for i in range(m):
    print(Z[i][0])


n,m=[int(i) for i in input().split()]
P=[[int(i) for i in input().split()] for j in range(m)]

def prefecturesort(i):
    return i[0]

def yearsort(i):
    return i[1]

W=[]
Z=[]

for i in range(m):
    P[i].append(i)
    W.append(P[i][0])

P.sort(key=prefecturesort)
P_c=[]
sum=0
for i in range(n):
    P_c.append(P[sum:W.count(i+1)+sum])
    sum+=c
    P_c[i].sort(key=yearsort)
for x in P_c:
    for j in range(len(x)):
        X=str("{0:06d}".format(x[j][0]))
        Y=str("{0:06d}".format(j+1))
        Z.append([X+Y,x[j][2]])
Z.sort(key=yearsort)
for i in range(m):
    print(Z[i][0])

n,m=[int(i) for i in input().split()]
P=[[int(i) for i in input().split()] for j in range(m)]

def prefecturesort(i):
    return i[0]

def yearsort(i):
    return i[1]

W=[0 for i in range(n)]
Z=[]

for i in range(m):
    P[i].append(i)
    W[P[i][0]-1]+=1

P.sort(key=prefecturesort)
P_c=[]
sum=0
for i in range(n):
    c=W[i]
    if c==0:
        P_c.append([])
    else:
        P_c.append(P[sum:c+sum])
    sum+=c
    P_c[i].sort(key=yearsort)
for x in P_c:
    for j in range(len(x)):
        X=str("{0:06d}".format(x[j][0]))
        Y=str("{0:06d}".format(j+1))
        Z.append([X+Y,x[j][2]])
Z.sort(key=yearsort)
for i in range(m):
    print(Z[i][0])
    

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 = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(N)]

PY = sorted(PY)

keyP = -1
for P, Y in PY:
  if keyP != P:
    keyP = P
    keyNo = 1

  print("{:0>6}{:0>6}", keyP, keyNo)
  keyNo += 1


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

PY = sorted(PY)

keyP = -1
for P, Y in PY:
  if keyP != P:
    keyP = P
    keyNo = 1

  print("{:0>6}{:0>6}".format(keyP, keyNo))
  keyNo += 1


N, M = map(int, input().split())
PY = [list(map(int, input().split() +[x])) for x in range(M)]

PY = sorted(PY)

keyP = -1
for i, (P, Y, _) in enumerate(PY):
  if keyP != P:
    keyP = P
    keyNo = 1

  PY[i].append("{:0>6}{:0>6}".format(keyP, keyNo))
  keyNo += 1

for P, Y, _, s in sorted(PY, key=lambda x:x[2]):
  print(s)


Verdicts: Runtime Error

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())
s = [[] for _ in range(n+1)]
for i in range(m):
    p,y = map(int,input().split())
    s[p].append([y,i])
s[p].sort()
ans = ['']*m
for p in range(1,n+1):
    cnt = 1
    for (y,i) in s[p]:
        ans[i] = '{:06}{:06}'.format(p,cnt)
        cnt += 1
print(' '.join(ans))

n,m = map(int,input().split())
s = [[] for _ in range(n+1)]
for i in range(m):
    p,y = map(int,input().split())
    s[p].append([y,i])
ans = [0]*m
for p in range(1,n+1):
    cnt = 1
    for (y,i) in sorted(s[p]):
        ans[i] = '{:06}{:06}'.format(p,cnt)
        cnt += 1
for j in range(len(ans)):
    print(ans[j])

Verdicts: Wrong Answer

Accepted