結果

問題 No.205 マージして辞書順最小
ユーザー PokerSodatsuPokerSodatsu
提出日時 2020-01-22 15:48:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 338 ms / 5,000 ms
コード長 212 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 11,364 KB
実行使用メモリ 15,528 KB
最終ジャッジ日時 2023-09-22 15:23:44
合計ジャッジ時間 4,006 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,116 KB
testcase_01 AC 78 ms
15,328 KB
testcase_02 AC 119 ms
15,256 KB
testcase_03 AC 123 ms
15,432 KB
testcase_04 AC 116 ms
15,248 KB
testcase_05 AC 113 ms
15,212 KB
testcase_06 AC 79 ms
15,168 KB
testcase_07 AC 186 ms
15,528 KB
testcase_08 AC 173 ms
15,356 KB
testcase_09 AC 178 ms
15,268 KB
testcase_10 AC 338 ms
15,496 KB
testcase_11 AC 293 ms
15,488 KB
testcase_12 AC 250 ms
15,504 KB
testcase_13 AC 188 ms
15,516 KB
testcase_14 AC 78 ms
15,304 KB
testcase_15 AC 76 ms
15,112 KB
testcase_16 AC 76 ms
15,060 KB
testcase_17 AC 78 ms
15,276 KB
testcase_18 AC 76 ms
15,232 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: assigned but unused variable - item
Syntax OK

ソースコード

diff #

n = gets.to_i
strs = n.times.map{(gets.chomp + '~').chars}
a = ''
flag = true
while flag
  item, i = strs.each_with_index.min
  b = strs[i].shift
  if b != '~'
    a << b
  else
    flag = false
  end
end
puts a
0