結果
問題 |
No.154 市バス
|
ユーザー |
![]() |
提出日時 | 2016-04-16 23:29:25 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 390 bytes |
コンパイル時間 | 71 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 19,904 KB |
最終ジャッジ日時 | 2024-10-13 08:16:57 |
合計ジャッジ時間 | 6,522 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 7 |
ソースコード
for _ in[0]*input(): s=list(raw_input()) while 1: w=g=r=-1 for i in xrange(len(s)): if s[i]=="W" and w==-1: w=i elif s[i]=="G" and g==-1: g=i elif s[i]=="R" and r==-1: r=i if w>=0 and g>=0 and r>=0: break if w>=0 and g>=0 and r>=0 and w<g<r: s[w]=s[g]=s[r]=None elif g==-1 and r==-1: print"possible" break else: print"impossible" break