結果
| 問題 | No.342 一番ワロタww |
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2018-02-18 22:34:23 |
| 言語 | Ruby (4.0.7 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 61 ms / 5,000 ms |
| + 88µs | |
| コード長 | 556 bytes |
| 記録 | |
| コンパイル時間 | 11 ms |
| コンパイル使用メモリ | 8,832 KB |
| 実行使用メモリ | 14,592 KB |
| 最終ジャッジ日時 | 2026-10-29 00:47:16 |
| 合計ジャッジ時間 | 2,854 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
コンパイルメッセージ
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