結果
| 問題 | No.154 市バス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-17 23:29:02 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 377 bytes |
| 記録 | |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 81,024 KB |
| 実行使用メモリ | 84,480 KB |
| 最終ジャッジ日時 | 2026-07-17 09:56:19 |
| 合計ジャッジ時間 | 2,380 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 s > 0: w += 1
if last < 0:
print "Impossible"
break
else:
print "Possible" if last == w == 0 else "Impossible"