結果

問題 No.154 市バス
ユーザー angel_p_57angel_p_57
提出日時 2016-06-10 22:03:50
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2024-04-21 09:30:25
合計ジャッジ時間 3,264 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 333 ms
13,440 KB
testcase_01 AC 334 ms
13,568 KB
testcase_02 AC 334 ms
13,568 KB
testcase_03 AC 302 ms
13,568 KB
testcase_04 WA -
testcase_05 AC 84 ms
12,288 KB
testcase_06 AC 83 ms
12,160 KB
testcase_07 AC 320 ms
13,568 KB
testcase_08 AC 86 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - i
Syntax OK

ソースコード

diff #

gets
$<.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"
}
0