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