結果
| 問題 |
No.539 インクリメント
|
| コンテスト | |
| ユーザー |
tubo28
|
| 提出日時 | 2017-06-30 23:08:33 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 310 ms / 2,000 ms |
| コード長 | 577 bytes |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 28,080 KB |
| 最終ジャッジ日時 | 2024-10-04 21:14:28 |
| 合計ジャッジ時間 | 1,476 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'set'
require 'rational'
$buf = []
def fill_buf; (s = gets) ? $buf = s.chomp.split : break while $buf.empty? end
def has_next; fill_buf; !$buf.empty? end
def get; fill_buf; $buf.shift end
def geti; get.to_i end
def getf; get.to_f end
def getss(n = nil); n ? Array.new(n) { get } : begin fill_buf; $buf.shift(1e9) end; end
def getis(n = nil); getss(n).map(&:to_i) end
def getfs(n = nil); getss(n).map(&:to_f) end
while has_next
geti.times do
s = gets
s.reverse!
s.sub!(/[0-9]+/) do |s|
s.reverse!.succ.reverse
end
puts s.reverse
end
end
tubo28