結果

問題 No.893 お客様を誘導せよ
ユーザー hiragnhiragn
提出日時 2022-11-13 09:01:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 12,412 KB
最終ジャッジ日時 2023-10-12 19:11:45
合計ジャッジ時間 1,597 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,096 KB
testcase_01 AC 16 ms
8,100 KB
testcase_02 AC 30 ms
8,992 KB
testcase_03 AC 69 ms
10,348 KB
testcase_04 AC 70 ms
10,032 KB
testcase_05 AC 64 ms
9,908 KB
testcase_06 AC 49 ms
9,440 KB
testcase_07 AC 16 ms
8,152 KB
testcase_08 AC 124 ms
12,412 KB
testcase_09 AC 24 ms
8,412 KB
testcase_10 AC 16 ms
8,140 KB
testcase_11 AC 26 ms
8,232 KB
testcase_12 AC 27 ms
8,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    a = [[] for _ in range(n)]

    for i in range(n):
        _, *a[i] = map(int, input().split())
        a[i] = a[i][::-1]  # pop用に逆順にする

    for i in range(10 ** 5):
        if a[i % n]:
            print(a[i % n].pop(), end=" ")
            if not any(a):  # 全員さばけたら終わり
                exit()


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