結果
| 問題 | No.154 市バス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-17 23:31:02 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 392 bytes |
| 記録 | |
| コンパイル時間 | 209 ms |
| コンパイル使用メモリ | 77,344 KB |
| 最終ジャッジ日時 | 2025-12-03 13:56:00 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | MLE * 1 |
| other | MLE * 8 |
ソースコード
T = int(raw_input())
for loop in xrange(T):
S = raw_input()
w = last = 0
for s in S:
if s == "G":
last += 1
w = 0
elif s == "R":
last -= 1
else:
if last > 0: w += 1
if last < 0:
print "Impossible"
break
else:
print "Possible" if last == w == 0 else "Impossible"