問題
ERROR: The request could not be satisfied

方針
誕生した年を配列に入れていき、ソートする。初めはheapqを用いたが、これはうまく行かなかった(原因不明)。素直にソートすれば時間はかかるが解決する。順位はbisectで検索するのが早い。その他いくつか。pythonのリスト内リストは以下のように作る。
[[] for _ in range()]
また、ゼロ埋めする時は、まず整数を文字型になおしてから、zfillでpaddingする。
提出コード
n = 10
str(n).zfill(5)
#00010
#input
n, m = map(int, input().split())
#output
#import heapq as hp
import bisect as bi
a = [[] for _ in range(n)]
b = [0] * m
c = [0] * m
for i in range(m):
p, y = map(int, input().split())
a[p-1].append(y)
b[i] = p
c[i] = y
for j in range(n):
a[j].sort()
for i in range(m):
print(str(b[i]).zfill(6), str(bi.bisect_left(a[b[i]-1], c[i])+1).zfill(6), sep = "")
提出結果
ERROR: The request could not be satisfied
コメント