結果

問題 No.539 インクリメント
ユーザー maimai
提出日時 2017-06-30 22:51:53
言語 Ruby
(3.3.0)
結果
AC  
実行時間 440 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 28,256 KB
最終ジャッジ日時 2024-04-15 06:50:26
合計ジャッジ時間 1,657 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
12,288 KB
testcase_01 AC 142 ms
28,124 KB
testcase_02 AC 209 ms
28,168 KB
testcase_03 AC 440 ms
28,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def ascan; gets.split.map{|e|Rational(e)}; end
def scan; gets.to_i; end

gets
while cin=gets
    str = cin.chomp
    #puts str.succ
    if str=~/\d/
        str = "$"+str
        
        sc = str.scan(/^(.*\D+)(\d+)(\D*)$/)[0]
        puts sc[0][1..-1]+sc[1].succ+sc[2]
    else
        puts str
    end
end
0