結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-11 18:06:07 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 188 bytes |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-09-13 20:11:53 |
| 合計ジャッジ時間 | 4,070 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 8 |
コンパイルメッセージ
Syntax OK
ソースコード
s = gets.chomp
result = s.length
is_exist = false
s.scan(/c[^cw]*?w[^cw]*?w/) do |m|
result = [m.length,result].min
is_exist = true
end
puts(if !is_exist then -1 else result end)