結果

問題 No.345 最小チワワ問題
ユーザー Takuya Noguchi
提出日時 2018-02-04 19:59:40
言語 Ruby
(3.4.1)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 161 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-09-25 12:11:30
合計ジャッジ時間 3,948 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp
puts s.chars.map.with_index { |c, i|
  next unless c == 'c'

  s[i..-1].scan(/c[^w]*?w[^w]*?w/).map(&:size).sort.first
}.compact.sort.first || -1
0