結果

問題 No.893 お客様を誘導せよ
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-01 17:47:30
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 87,748 KB
最終ジャッジ日時 2023-08-25 23:48:49
合計ジャッジ時間 2,614 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,172 KB
testcase_01 AC 62 ms
71,316 KB
testcase_02 AC 90 ms
76,560 KB
testcase_03 AC 97 ms
81,456 KB
testcase_04 AC 101 ms
81,040 KB
testcase_05 AC 96 ms
79,964 KB
testcase_06 AC 89 ms
79,868 KB
testcase_07 AC 61 ms
71,096 KB
testcase_08 AC 107 ms
87,748 KB
testcase_09 AC 77 ms
76,460 KB
testcase_10 AC 60 ms
71,184 KB
testcase_11 AC 76 ms
76,224 KB
testcase_12 AC 82 ms
76,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = [0]*n
for i in range(n):
    temp = list(map(int, input().split()))
    if len(temp) == 1:
        A[i] = []
    else:
        a = temp[1:]
        a.reverse()
        A[i] = a

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