結果

問題 No.893 お客様を誘導せよ
ユーザー ThetaTheta
提出日時 2022-11-01 18:57:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 15,564 KB
最終ジャッジ日時 2023-09-23 09:26:47
合計ジャッジ時間 1,931 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,604 KB
testcase_01 AC 18 ms
8,612 KB
testcase_02 AC 29 ms
9,432 KB
testcase_03 AC 59 ms
12,224 KB
testcase_04 AC 58 ms
12,144 KB
testcase_05 AC 55 ms
11,544 KB
testcase_06 AC 43 ms
10,716 KB
testcase_07 AC 18 ms
8,600 KB
testcase_08 AC 103 ms
15,564 KB
testcase_09 AC 22 ms
9,420 KB
testcase_10 AC 18 ms
8,580 KB
testcase_11 AC 23 ms
9,216 KB
testcase_12 AC 23 ms
9,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque


def main():
    N = int(input())
    consumers = []
    for _ in range(N):
        _, *p = map(int, input().split())
        consumers.append(deque(p))
    new_waited = []

    while consumers:
        for consumer in consumers:
            try:
                new_waited.append(consumer.popleft())
            except IndexError:
                pass
        consumers = list(filter(lambda elm: len(elm) > 0, consumers))

    print(*new_waited)


if __name__ == "__main__":
    main()
0