結果

問題 No.345 最小チワワ問題
ユーザー gemmarogemmaro
提出日時 2019-08-11 17:43:18
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 193 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 15,424 KB
最終ジャッジ日時 2023-10-11 21:19:03
合計ジャッジ時間 4,363 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,148 KB
testcase_01 AC 82 ms
15,048 KB
testcase_02 AC 82 ms
15,048 KB
testcase_03 AC 83 ms
15,156 KB
testcase_04 AC 82 ms
15,292 KB
testcase_05 WA -
testcase_06 AC 81 ms
15,032 KB
testcase_07 AC 81 ms
15,220 KB
testcase_08 AC 82 ms
15,040 KB
testcase_09 AC 81 ms
15,152 KB
testcase_10 AC 82 ms
15,376 KB
testcase_11 AC 83 ms
15,168 KB
testcase_12 AC 82 ms
15,128 KB
testcase_13 AC 83 ms
15,164 KB
testcase_14 AC 83 ms
15,304 KB
testcase_15 AC 83 ms
15,112 KB
testcase_16 AC 82 ms
15,084 KB
testcase_17 AC 83 ms
15,224 KB
testcase_18 WA -
testcase_19 AC 82 ms
15,260 KB
testcase_20 AC 82 ms
15,076 KB
testcase_21 AC 83 ms
15,056 KB
testcase_22 AC 81 ms
15,160 KB
testcase_23 AC 83 ms
15,148 KB
testcase_24 AC 81 ms
15,148 KB
testcase_25 AC 82 ms
15,312 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 82 ms
15,224 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 81 ms
15,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp

result = s.length
is_exist = false
s.match(/(c[^cw]*w[^w]*w)/) do |m|
    result = [m.to_s.length,result].min
    is_exist = true
end

puts(if !is_exist then -1 else result end)
0