結果
問題 | No.154 市バス |
ユーザー |
![]() |
提出日時 | 2015-02-19 02:29:12 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 498 bytes |
コンパイル時間 | 533 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-13 06:57:53 |
合計ジャッジ時間 | 2,672 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 6 WA * 2 |
ソースコード
T=int(raw_input()) for i in range(T): S=raw_input() Wcnt=0 Gcnt=0 ok=True for s in S: if s=='W': ok=False Wcnt+=1 if s=='G': ok=False if Wcnt < 1: break Wcnt-=1 Gcnt+=1 if s=='R': if Gcnt <= 0: ok=False break ok=True Gcnt-=1 if ok: print 'possible' else: print 'impossible'