結果
問題 | No.342 一番ワロタww |
ユーザー |
![]() |
提出日時 | 2016-02-12 22:46:27 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 85 ms / 5,000 ms |
コード長 | 898 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-10-15 13:12:21 |
合計ジャッジ時間 | 2,214 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
コンパイルメッセージ
Syntax OK
ソースコード
# coding: utf-8str = gets.chomplen = str.lengthi = 0while i < len && str[i] == "w" doi = i+1endstr = str[i, len-i]len = str.lengthl = 0r = 0maxi = 0while l < len doif str[l] != "w" thenl = l+1elser = lwhile r < len && str[r] == "w"r = r+1endmaxi = [maxi, r-l].maxl = rendendif maxi==0 || len==0 thenprint "\n"elseans = []l = 0r = 0while l < len doif (str[l] != "w") thenm = lwhile m < len && str[m] != "w"m = m+1endr = mwhile r < len && str[r] == "w"r = r+1endif r-m == maxi thenans.push(str[l, m-l])endl = rendendans.each do |s|print s, "\n"endend