結果
| 問題 | No.154 市バス |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2015-02-19 02:29:12 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 498 bytes |
| 記録 | |
| コンパイル時間 | 104 ms |
| コンパイル使用メモリ | 77,476 KB |
| 最終ジャッジ日時 | 2025-12-03 13:59:25 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | MLE * 1 |
| other | MLE * 8 |
ソースコード
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'
yaoshimax