結果

問題 No.893 お客様を誘導せよ
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-02-07 22:31:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 19,028 KB
最終ジャッジ日時 2023-10-25 23:19:48
合計ジャッジ時間 3,071 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
16,220 KB
testcase_01 AC 84 ms
16,220 KB
testcase_02 AC 96 ms
16,852 KB
testcase_03 AC 128 ms
17,684 KB
testcase_04 AC 132 ms
17,684 KB
testcase_05 AC 125 ms
17,588 KB
testcase_06 AC 114 ms
16,992 KB
testcase_07 AC 84 ms
16,220 KB
testcase_08 AC 167 ms
19,028 KB
testcase_09 AC 87 ms
16,220 KB
testcase_10 AC 84 ms
16,220 KB
testcase_11 AC 93 ms
16,220 KB
testcase_12 AC 92 ms
16,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i
a = []
ans = []
sum = 0
n.times do
  r = gets.chomp.split.map(&:to_i)
  sum += r.shift
  a << r
end
while ans.size < sum
  a.each do |ai|
    next if ai.empty?
    ans << ai.shift
  end
end
puts ans.join(' ')
0