結果

問題 No.154 市バス
ユーザー tabataba
提出日時 2016-04-16 23:19:48
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 297 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 20,160 KB
最終ジャッジ日時 2024-04-21 09:23:42
合計ジャッジ時間 8,640 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 WA -
testcase_06 WA -
testcase_07 TLE -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in[0]*input():
	s=list(raw_input())
	while"W"in s:
		w=s.index("W")
		if "G"not in s:
			break
		g=s.index("G")
		if "R"not in s:
			break
		r=s.index("R")
		if w<g<r:
			s.pop(r)
			s.pop(g)
			s.pop(w)
		else:
			break
	if s.count("W")==len(s):
		print"possible"
	else:
		print"impossible"
0