結果

問題 No.154 市バス
ユーザー matriematrie
提出日時 2021-01-04 22:00:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 315 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,504 KB
最終ジャッジ日時 2024-04-23 07:07:44
合計ジャッジ時間 16,436 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n=int(input())
a,r,g,w="impossible",'R','G','W'
for i in range(n):
	l=[]
	c=0
	for x in input()[::-1]:
		if x==w and 2 in l: l[l.index(2)]=3
		elif x==w and 3 in l: continue
		elif x==g and 1 in l: l[l.index(1)]=2
		elif x==r: l.append(1)
		else: c=1; break
	if len(l)<1: c=1
	elif min(l)<3: c=1
	print(a[(c<1)*2:])
0