結果
| 問題 |
No.342 一番ワロタww
|
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2018-02-18 22:34:23 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 86 ms / 5,000 ms |
| コード長 | 556 bytes |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-10-15 13:37:00 |
| 合計ジャッジ時間 | 2,173 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
コンパイルメッセージ
Syntax OK
ソースコード
# coding: utf-8
s=gets.chomp
s = s.sub(/\Aw+/, "")
s = s.sub(/[^w]+\Z/, "")
if s.count("w") == s.size then
puts ""
elsif s.include?("w") == false then
puts ""
else
i = 0
j = 0
mx = 0
ss = []
while i < s.size do
while j < s.size && s[j] != "w" do
j += 1
end
a = s[i, j-i]
i = j
while j < s.size && s[j] == "w" do
j += 1
end
n = j - i
if mx < n then
mx = n
ss = [a]
elsif mx == n then
ss << a
end
i = j
end
ss.each do |s|
puts s
end
end
tottoripaper