結果

問題 No.893 お客様を誘導せよ
コンテスト
ユーザー brthyyjp
提出日時 2020-05-01 17:47:30
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 67 ms / 2,000 ms
+ 894µs
コード長 385 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 107 ms
コンパイル使用メモリ 80,768 KB
実行使用メモリ 92,160 KB
最終ジャッジ日時 2026-10-12 19:46:02
合計ジャッジ時間 2,109 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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