結果

問題 No.893 お客様を誘導せよ
ユーザー lloyz
提出日時 2022-03-22 00:29:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-10-09 15:28:26
合計ジャッジ時間 2,269 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

n = int(input())
L = []
for _ in range(n):
    Q = deque(map(int, input().split()))
    Q.popleft()
    L.append(Q)

ANS = []
while True:
    cnt = 0
    for i in range(n):
        if L[i]:
            ANS.append(L[i].popleft())
        else:
            cnt += 1
    if cnt == n:
        break
print(*ANS)
0