Problem p03221 (python)

Fixed submission:
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)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
tmps = [[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()))
    tmps[p].append(y)
    pys.append([p, y])
    
for i in range(m):
    tmps[i].sort()
 
for py in pys:
    p, y = py
    yindex = tmps[p].index(y)
    print('{:06}'.format(p) + '{:06}'.format(yindex))

Buggy submission (verdict: Runtime Error):
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])

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

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

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

Buggy submission (verdict: Runtime Error):
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])

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

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

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

Buggy submission (verdict: Runtime Error):
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])

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

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

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

Buggy submission (verdict: Runtime Error):
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])

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

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

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

Buggy submission (verdict: Runtime Error):
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))