結果

問題 No.893 お客様を誘導せよ
ユーザー hedwig100
提出日時 2020-04-20 14:16:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-10-06 08:42:12
合計ジャッジ時間 2,013 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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