結果

問題 No.154 市バス
ユーザー cielciel
提出日時 2015-02-18 00:24:05
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 201 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-21 07:52:35
合計ジャッジ時間 1,490 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
puts gets.to_i.times.map{|e|
	w=g=0
	s=e.chomp
	s.chars{|c|
		if c=='R'
			g-=1
			g=0 if g<0
		elsif c=='G'
			w=0
			g+=1
		else
			w+=1
		end
	}
	w>0||g>0 ? :impossible : :possible
}
0