結果

問題 No.154 市バス
ユーザー cielciel
提出日時 2015-02-18 00:33:15
言語 Ruby
(3.2.2)
結果
AC  
実行時間 405 ms / 2,000 ms
コード長 230 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 11,512 KB
実行使用メモリ 15,444 KB
最終ジャッジ日時 2023-08-03 09:12:51
合計ジャッジ時間 3,803 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 405 ms
15,256 KB
testcase_01 AC 400 ms
15,368 KB
testcase_02 AC 400 ms
15,444 KB
testcase_03 AC 310 ms
15,420 KB
testcase_04 AC 380 ms
15,240 KB
testcase_05 AC 86 ms
15,112 KB
testcase_06 AC 85 ms
15,136 KB
testcase_07 AC 389 ms
15,260 KB
testcase_08 AC 85 ms
15,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
puts gets.to_i.times.map{|e|
	w=g=r=f=0
	gets.chomp.chars{|c|
		if c=='R'
			r+=1
			break if w<r||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