結果
問題 |
No.154 市バス
|
ユーザー |
|
提出日時 | 2016-03-14 20:08:03 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 420 bytes |
コンパイル時間 | 75 ms |
コンパイル使用メモリ | 6,784 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-10-13 08:10:43 |
合計ジャッジ時間 | 4,401 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 6 WA * 2 |
ソースコード
# coding: utf-8 #yuki_154 t=int(raw_input()) for i in xrange(t): s=raw_input() rgcount=0 rflag=False gflag=False for j in xrange(len(s)): st=s[-1] if st=='R': rgcount+=1 rflag=True elif st=='G': rgcount-=1 gflag=True elif st=='W': if rflag==False or gflag==False: print "impossible" break if rgcount<0: print "impossible" break s=s[:-1] if len(s)==0: print "possible"