結果

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

ソースコード

diff #

s = gets.chomp
ans = 0
while s != ''
    if s =~ /…+/
        ans = [ans,$&.length].max
        s = $'.to_s
    else
        s = ''
    end
end

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