結果

問題 No.345 最小チワワ問題
ユーザー fine
提出日時 2016-03-04 17:25:34
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 169 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-09-24 14:06:59
合計ジャッジ時間 3,597 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

s = gets.chomp
ans = 1000
while s != ''
    if s =~ /c.*?w.*?w/
        ans = [ans,$&.length].min
    end
    s = $'.to_s
end

if ans == 1000
    p -1
else
    p ans
end
0