結果

問題 No.893 お客様を誘導せよ
ユーザー ch1channnch1channn
提出日時 2023-01-24 22:17:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 682 bytes
コンパイル時間 1,015 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 87,964 KB
最終ジャッジ日時 2023-09-08 14:30:13
合計ジャッジ時間 2,494 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,416 KB
testcase_01 AC 71 ms
71,276 KB
testcase_02 AC 90 ms
76,528 KB
testcase_03 AC 114 ms
81,352 KB
testcase_04 AC 110 ms
81,232 KB
testcase_05 AC 107 ms
80,500 KB
testcase_06 AC 103 ms
79,620 KB
testcase_07 AC 72 ms
71,276 KB
testcase_08 AC 127 ms
87,964 KB
testcase_09 AC 97 ms
76,140 KB
testcase_10 AC 73 ms
70,976 KB
testcase_11 AC 86 ms
76,248 KB
testcase_12 AC 98 ms
76,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
if sys.platform =='ios':
	import clipboard
	a=clipboard.get()
	a = a.split('\n')
	text = '\n'.join(a)
	with open('input_file.txt','w') as f:
		f.write(text)
	sys.stdin = open('input_file.txt')
sys.setrecursionlimit(4100000)
stdin = sys.stdin 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

n = ni()
line = []
for i in range(n):
    p=list(map(int,input().split()))
    if p[0]==0:
        continue
    
    a=p[1:][::-1]
    line.append(a)
ans=[]
while line:
    ne=[]
    for x in line:
        tmp=x.pop()
        ans.append(tmp)
        if len(x)!=0:
            ne.append(x)
    line=ne
print(*ans)
0