結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-10 13:03:03 |
| 言語 | Ruby (4.0.6 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 225 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 22,272 KB |
| 最終ジャッジ日時 | 2026-08-19 14:16:47 |
| 合計ジャッジ時間 | 4,171 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