結果

問題 No.893 お客様を誘導せよ
ユーザー hedwig100hedwig100
提出日時 2020-04-20 14:16:38
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 14,968 KB
最終ジャッジ日時 2023-07-28 16:21:01
合計ジャッジ時間 2,063 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,604 KB
testcase_01 AC 18 ms
8,512 KB
testcase_02 AC 30 ms
9,524 KB
testcase_03 AC 61 ms
11,744 KB
testcase_04 AC 60 ms
11,572 KB
testcase_05 AC 59 ms
11,512 KB
testcase_06 AC 44 ms
10,560 KB
testcase_07 AC 18 ms
8,512 KB
testcase_08 AC 99 ms
14,968 KB
testcase_09 AC 22 ms
8,808 KB
testcase_10 AC 18 ms
8,632 KB
testcase_11 AC 26 ms
8,724 KB
testcase_12 AC 26 ms
8,768 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