結果
問題 |
No.154 市バス
|
ユーザー |
|
提出日時 | 2023-06-15 00:44:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 425 bytes |
コンパイル時間 | 434 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-23 05:20:05 |
合計ジャッジ時間 | 2,668 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 7 WA * 1 |
ソースコード
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")