結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-10 13:03:03 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 225 bytes |
| 記録 | |
| コンパイル時間 | 60 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 44,800 KB |
| 最終ジャッジ日時 | 2026-04-02 21:03:27 |
| 合計ジャッジ時間 | 3,044 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 15 RE * 7 |
コンパイルメッセージ
Main.rb:17: warning: ambiguous first argument; put parentheses or a space even after `-` operator Syntax OK
ソースコード
input = gets.chomp
size = input.size
for i in 0..size-1
if input[i] == "c"
x = i
next
end
if input[i] == "w"
y = i
next
end
end
if x < y
puts y - x + 1
else
puts -1
end