結果
問題 | No.342 一番ワロタww |
ユーザー |
![]() |
提出日時 | 2016-02-12 22:54:56 |
言語 | Ruby (3.4.1) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 570 bytes |
コンパイル時間 | 195 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-09-22 04:48:07 |
合計ジャッジ時間 | 2,400 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
#using : utf-8#encoding : utf-8s = gets.chompans = 0len = 0con = falsedot = "w"arr = Array.new(s.length)for i in 0...s.length doarr[i] = -1if s[i] == dot thenif con == true thenlen += 1ans = [ans, len].maxelsecon = truelen = 1ans = [ans, len].maxendarr[i] = 0arr[i-len+1] = lenelselen = 0con = falseendendfor i in 1...s.length doif arr[i] > 0 thenif arr[i] == ans thenx = i-1while x > 0 && s[x-1] != dot dox -= 1endputs s[x, i-x]endendendif ans == 0 thenputs ""end