結果

問題 No.342 一番ワロタww
ユーザー izryt(趣味)izryt(趣味)
提出日時 2016-02-13 01:29:37
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 16,120 KB
最終ジャッジ日時 2023-10-22 04:01:19
合計ジャッジ時間 2,466 ms
ジャッジサーバーID
(参考情報)
judge14 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
16,120 KB
testcase_01 AC 84 ms
16,120 KB
testcase_02 AC 85 ms
16,120 KB
testcase_03 AC 84 ms
16,120 KB
testcase_04 AC 85 ms
16,120 KB
testcase_05 AC 87 ms
16,120 KB
testcase_06 AC 85 ms
16,120 KB
testcase_07 AC 87 ms
16,120 KB
testcase_08 AC 83 ms
16,120 KB
testcase_09 AC 83 ms
16,120 KB
testcase_10 AC 84 ms
16,120 KB
testcase_11 AC 83 ms
16,120 KB
testcase_12 AC 83 ms
16,120 KB
testcase_13 AC 84 ms
16,120 KB
testcase_14 AC 82 ms
16,120 KB
testcase_15 AC 84 ms
16,120 KB
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp.gsub(/^w/, '')

cnt, longest = 0, 0

s.split('').each do |c|
  if c == 'w'
    cnt += 1
    longest = longest < cnt ? cnt : longest
  else
    cnt = 0
  end
end

if longest == 0 or longest == s.length
  puts
  exit true
end

regex = Regexp.new("[^w]+?w{#{longest}}")

arr = s.scan(regex)

if arr.length == 0
  puts
  exit true
end

puts arr.map{|item| item.gsub(/w+/, '')}
0