結果

問題 No.893 お客様を誘導せよ
ユーザー lloyzlloyz
提出日時 2022-03-22 00:29:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-04-17 21:39:40
合計ジャッジ時間 2,163 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 47 ms
11,904 KB
testcase_03 AC 99 ms
14,336 KB
testcase_04 AC 86 ms
14,336 KB
testcase_05 AC 83 ms
14,080 KB
testcase_06 AC 70 ms
13,056 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 146 ms
18,048 KB
testcase_09 AC 34 ms
11,648 KB
testcase_10 AC 30 ms
10,880 KB
testcase_11 AC 51 ms
11,648 KB
testcase_12 AC 50 ms
11,648 KB
権限があれば一括ダウンロードができます

ソースコード

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