結果
問題 |
No.154 市バス
|
ユーザー |
|
提出日時 | 2023-06-15 00:43:47 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 425 bytes |
コンパイル時間 | 328 ms |
コンパイル使用メモリ | 82,384 KB |
実行使用メモリ | 76,612 KB |
最終ジャッジ日時 | 2024-06-23 05:19:59 |
合計ジャッジ時間 | 1,831 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 2 MLE * 6 |
ソースコード
for _ in range(int(input())): s = input() n = len(s) r = 0 GR = False for i in range(n - 1, -1, -1): if s[i] == 'R': r += 1 elif s[i] == 'G': r -= 1 if r == -1: break GR = True else: if not GR: break if r != 0 or not GR: print("impossible") else: print("possible")