結果
| 問題 | No.154 市バス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-17 23:34:48 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 379 bytes |
| 記録 | |
| コンパイル時間 | 135 ms |
| コンパイル使用メモリ | 77,268 KB |
| 最終ジャッジ日時 | 2025-12-03 13:56:02 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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:
w += 1
if last < 0:
print "impossible"
break
else:
print "possible" if last == w == 0 else "impossible"