結果
問題 | No.517 壊れたアクセサリー |
ユーザー |
![]() |
提出日時 | 2017-08-20 07:19:41 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 91 ms / 2,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-10-14 17:10:32 |
合計ジャッジ時間 | 2,782 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 15 |
コンパイルメッセージ
Main.rb:21: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
m={}2.times dogets.to_i.times dos = gets.chomps[0...-1].chars.each_with_index do |c, i|m[c] = s[i+1]endm[s[-1]] ||= nil;endendcase m.to_a.map(&:last).count(nil)when 1c = nils = ""while m.key(c) dos << m.key(c)c = m.key(c)endputs s.reverseelseputs -1end