結果

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

ソースコード

diff #

n = int(input())

A = [list(map(int, input().split()[1:][::-1])) for i in range(n)]
B = []

cnt = sum([len(a) for a in A])
i = -1
while cnt > 0:
    i += 1
    if not A[i % n]:
        continue
    B.append(A[i % n].pop())
    cnt -= 1

print(*B)
0