結果
問題 | No.536 人工知能 |
ユーザー |
![]() |
提出日時 | 2017-06-30 22:38:01 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 76 ms / 1,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 61 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-10-04 20:35:45 |
合計ジャッジ時間 | 1,596 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
コンパイルメッセージ
Syntax OK
ソースコード
$buf = []def fill_buf; (s = gets) ? $buf = s.chomp.split : break while $buf.empty? enddef has_next; fill_buf; !$buf.empty? enddef get; fill_buf; $buf.shift enddef geti; get.to_i enddef getf; get.to_f enddef getss(n = nil); n ? Array.new(n) { get } : begin fill_buf; $buf.shift(1e9) end; enddef getis(n = nil); get_ss(n).map(&:to_i) enddef getfs(n = nil); get_ss(n).map(&:to_f) endwhile has_nexts = getans = if s =~ /ai$/s.sub(/ai$/, "AI")elses.sub(/$/, "-AI")endputs ansend