結果
問題 |
No.342 一番ワロタww
|
ユーザー |
![]() |
提出日時 | 2016-02-12 22:51:55 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 573 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-09-22 04:46:41 |
合計ジャッジ時間 | 2,271 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 3 WA * 11 |
コンパイルメッセージ
Syntax OK
ソースコード
#using : utf-8 #encoding : utf-8 s = gets.chomp ans = 0 len = 0 con = false dot = "w" arr = Array.new(s.length) for i in 0...s.length do arr[i] = -1 if s[i] == dot then if con == true then len += 1 ans = [ans, len].max else con = true len = 1 ans = [ans, len].max end arr[i] = 0 arr[i-len+1] = len else len = 0 con = false end end for i in 1...s.length do if arr[i] > 0 then if arr[i] == ans then x = i-1 while x >= 0 && s[x-1] != dot do x -= 1 end puts s[x, i-x+1] end end end if ans == 0 then puts "" end