結果
問題 |
No.205 マージして辞書順最小
|
ユーザー |
![]() |
提出日時 | 2018-05-23 06:13:11 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 387 bytes |
コンパイル時間 | 365 ms |
コンパイル使用メモリ | 7,200 KB |
実行使用メモリ | 14,976 KB |
最終ジャッジ日時 | 2024-06-28 16:06:18 |
合計ジャッジ時間 | 2,691 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 7 WA * 8 |
コンパイルメッセージ
Syntax OK
ソースコード
str = STDIN.read lines = str.split(/\n/) lines.shift output = "" while true do if lines.length == 0 then break end lines.sort! output += lines[0][0] new_str = lines[0][1..lines[0].length] if new_str == "" then lines.delete_at(0) else lines[0] = new_str end end puts(output)