結果
| 問題 |
No.154 市バス
|
| コンテスト | |
| ユーザー |
angel_p_57
|
| 提出日時 | 2016-06-10 22:03:01 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 232 bytes |
| コンパイル時間 | 389 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 13,568 KB |
| 最終ジャッジ日時 | 2024-10-13 08:23:01 |
| 合計ジャッジ時間 | 3,886 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 8 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - i Syntax OK
ソースコード
$<.each{|s|
r=g=n=0;i=0
puts s.chop.chars.reverse_each{|c|
case c
when ?R
r+=1
when ?G
break if 0>r-=1
g+=1
else
(break if n<1)if g<1
g-=1
n+=1
end
}&&n>0&&r<1&&g<1 ? "possible" : "impossible"
}
angel_p_57