結果

問題 No.342 一番ワロタww
ユーザー cympfh
提出日時 2016-02-14 16:37:43
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-09-22 06:31:08
合計ジャッジ時間 2,349 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 13 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s=gets
ac=0
fr=''
last=false
ls = []
for i in 0...s.size
  if s[i] == 'w'
    ac += 1
    last = true
  else
    if last
      ls << [ac, fr]
      ac=0
      fr=''
    end
    last=false
    fr += s[i]
  end
end

n = ls.map{|a|a[0]}.max
for x,f in ls
  puts f if n == x
end
0