結果

問題 No.154 市バス
ユーザー cielciel
提出日時 2015-02-18 01:14:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 388 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 13,184 KB
最終ジャッジ日時 2024-04-21 07:59:13
合計ジャッジ時間 3,575 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 388 ms
12,928 KB
testcase_01 AC 384 ms
13,056 KB
testcase_02 AC 378 ms
13,184 KB
testcase_03 AC 296 ms
13,184 KB
testcase_04 AC 360 ms
12,928 KB
testcase_05 AC 78 ms
12,160 KB
testcase_06 AC 77 ms
12,160 KB
testcase_07 AC 367 ms
13,056 KB
testcase_08 AC 79 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

puts$<.drop(1).map{|e|
	w=g=r=f=0
	e.chomp.chars{|c|
		if c=='R'
			r+=1
			break if g<r
		elsif c=='G'
			f=0
			g+=1
			break if w<g
		else
			w+=f=1
		end
	}&&g==r&&f==0?:possible: :impossible
}
0