結果

問題 No.893 お客様を誘導せよ
ユーザー kohei2019kohei2019
提出日時 2022-01-10 12:47:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 82,344 KB
実行使用メモリ 88,576 KB
最終ジャッジ日時 2024-04-26 20:03:15
合計ジャッジ時間 2,431 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,760 KB
testcase_01 AC 41 ms
53,632 KB
testcase_02 AC 64 ms
73,216 KB
testcase_03 AC 92 ms
81,792 KB
testcase_04 AC 88 ms
81,804 KB
testcase_05 AC 94 ms
81,420 KB
testcase_06 AC 79 ms
79,068 KB
testcase_07 AC 41 ms
53,632 KB
testcase_08 AC 114 ms
88,576 KB
testcase_09 AC 66 ms
69,376 KB
testcase_10 AC 42 ms
53,504 KB
testcase_11 AC 60 ms
66,688 KB
testcase_12 AC 70 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N = int(input())
ls = []
for i in range(N):
    a = list(map(int,input().split()))
    if len(a) == 1:
        ls.append(collections.deque())
    else:
        ls.append(collections.deque(a[1:]))
ans = []
while ls:
    ll = []
    for q in ls:
        if not q:
            continue
        ans.append(q.popleft())
        ll.append(q)
    ls = ll
print(*ans)
0