結果

問題 No.893 お客様を誘導せよ
ユーザー brthyyjp
提出日時 2020-05-01 17:47:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 86,784 KB
最終ジャッジ日時 2024-12-24 11:52:41
合計ジャッジ時間 2,797 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = [0]*n
for i in range(n):
    temp = list(map(int, input().split()))
    if len(temp) == 1:
        A[i] = []
    else:
        a = temp[1:]
        a.reverse()
        A[i] = a

ans = []
while True:
    cnt = 0
    for i in range(n):
        if A[i]:
            ans.append(A[i].pop())
        else:
            cnt += 1
    if cnt == n:
        break
print(*ans)
0