結果

問題 No.154 市バス
ユーザー cielciel
提出日時 2015-02-18 00:31:40
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 213 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 13,312 KB
最終ジャッジ日時 2024-04-21 07:54:03
合計ジャッジ時間 3,936 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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