結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,076 KB
testcase_01 AC 17 ms
8,068 KB
testcase_02 AC 33 ms
8,824 KB
testcase_03 AC 72 ms
10,044 KB
testcase_04 AC 70 ms
10,080 KB
testcase_05 AC 65 ms
9,988 KB
testcase_06 AC 50 ms
9,264 KB
testcase_07 AC 16 ms
8,172 KB
testcase_08 AC 124 ms
12,392 KB
testcase_09 AC 24 ms
8,256 KB
testcase_10 AC 16 ms
8,168 KB
testcase_11 AC 26 ms
8,152 KB
testcase_12 AC 27 ms
8,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

    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