結果

問題 No.893 お客様を誘導せよ
ユーザー DrDrpilot
提出日時 2022-04-10 18:32:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,152 KB
最終ジャッジ日時 2024-12-14 07:25:35
合計ジャッジ時間 2,339 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
line=[]
for _ in range(n):
    p=list(map(int,input().split()))
    if p[0]==0:
        continue
    a=p[1:][::-1]
    line.append(a)
ans=[]

while line:
    next_line=[]
    for i in line:
        tmp=i.pop()
        ans.append(tmp)
        if len(i)!=0:
            next_line.append(i)
    line=next_line
print(*ans)
0