結果

問題 No.893 お客様を誘導せよ
ユーザー hiragn
提出日時 2022-11-13 09:00:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2024-09-14 17:35:14
合計ジャッジ時間 2,183 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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