結果

問題 No.154 市バス
ユーザー IJKTanabeIJKTanabe
提出日時 2019-09-04 14:05:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2023-08-27 05:06:30
合計ジャッジ時間 1,999 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
7,824 KB
testcase_01 AC 171 ms
7,796 KB
testcase_02 AC 163 ms
7,824 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 176 ms
7,796 KB
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

count = int(input())
result = []

for i in range(count):
    memo = input()
    judge = 0
    for char in reversed(memo):
        if char == 'R':
            judge += 1
        elif char == 'G':
            judge -= 1
        
        if judge < 0:
            break
    if judge < 0:
        result.append("impossible")
    else:
        result.append("possible")
for r in result:
    print(r)
 
0