結果

問題 No.893 お客様を誘導せよ
ユーザー hedwig100hedwig100
提出日時 2020-04-20 14:16:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-04-16 00:37:00
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 34 ms
10,752 KB
testcase_02 AC 44 ms
11,648 KB
testcase_03 AC 86 ms
13,952 KB
testcase_04 AC 86 ms
13,952 KB
testcase_05 AC 80 ms
13,696 KB
testcase_06 AC 65 ms
12,800 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 141 ms
17,280 KB
testcase_09 AC 35 ms
10,880 KB
testcase_10 AC 30 ms
10,880 KB
testcase_11 AC 41 ms
10,880 KB
testcase_12 AC 41 ms
11,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from  collections import deque

def main():
    n = int(input())
    ans = []
    cus = []

    for _ in range(n):
        a = list(map(int,input().split()))
        a = a[::-1]
        cus.append(a[:-1])
    
    while True:
        update = False
        for i in range(n):
            if len(cus[i]) > 0:
                p = cus[i].pop()
                ans.append(p)
                update = True

        if not update:
            break
    
    print(*ans)
if __name__ == '__main__':
    main()
0