結果

問題 No.539 インクリメント
ユーザー char134217728char134217728
提出日時 2017-08-19 23:21:57
言語 Ruby
(3.3.0)
結果
AC  
実行時間 401 ms / 2,000 ms
コード長 160 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 23,296 KB
最終ジャッジ日時 2024-04-22 16:44:55
合計ジャッジ時間 2,214 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
12,288 KB
testcase_01 AC 334 ms
17,792 KB
testcase_02 AC 286 ms
17,920 KB
testcase_03 AC 401 ms
23,296 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
n.times do
  s = gets.chomp
  s =~ /([0-8]?9*)([^\d]*?)\z/
  if $1.length > 0
    puts ($` << ($1.to_i + 1).to_s << $2)
  else
    puts s
  end
end
0