結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
![]() |
提出日時 | 2019-01-26 18:19:04 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 419 bytes |
コンパイル時間 | 340 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-09-16 16:12:24 |
合計ジャッジ時間 | 4,724 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 14 |
コンパイルメッセージ
Syntax OK
ソースコード
strs = gets.chomp.scan(/c.*w.*w/) if strs.length == 0 puts "-1" else c,w1,w2 = false, false, false count = 0 strs[0].chars do |s| count += 1 if s == "c" c = true elsif s == "w" and not w1 w1 = true elsif s == "w" and w1 w2 = true end if c and w1 and w2 puts count break end end end