結果

問題 No.893 お客様を誘導せよ
ユーザー 👑 horiesinitihoriesiniti
提出日時 2023-02-07 13:54:46
言語 Ruby
(3.3.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 11,548 KB
実行使用メモリ 22,756 KB
最終ジャッジ日時 2023-09-18 21:27:09
合計ジャッジ時間 2,720 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,084 KB
testcase_01 AC 80 ms
15,188 KB
testcase_02 AC 89 ms
15,584 KB
testcase_03 AC 107 ms
18,384 KB
testcase_04 AC 108 ms
18,368 KB
testcase_05 AC 102 ms
17,628 KB
testcase_06 AC 96 ms
16,828 KB
testcase_07 AC 79 ms
15,340 KB
testcase_08 AC 132 ms
22,756 KB
testcase_09 AC 81 ms
15,148 KB
testcase_10 AC 78 ms
15,280 KB
testcase_11 AC 88 ms
15,352 KB
testcase_12 AC 88 ms
15,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
xs=[]
all=0
n.times{
	es=gets.chomp.split(" ")
	all+=es.shift.to_i
	xs<<es
}

x=0
ans=[]
while all>0 do
	n.times{|y|
		next if xs[y].size<=x
		ans<<xs[y][x]
		all-=1
	}
	x+=1
end
puts ans.join(" ")
0