結果

問題 No.154 市バス
ユーザー TsubajiroTsubajiro
提出日時 2022-05-20 23:10:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 11,196 KB
最終ジャッジ日時 2023-10-20 14:03:27
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 186 ms
11,140 KB
testcase_01 AC 191 ms
11,140 KB
testcase_02 AC 189 ms
11,140 KB
testcase_03 AC 200 ms
11,140 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 201 ms
11,116 KB
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
tt=[]
for _ in range(T):
    tt.append(input())
for t in tt:
    #print(len(t))
    count=0
    for i in t:
        if i=="G":
            count+=1
        elif i=="R":
            count-=1
        if count<0:
            count=-10**5
            continue
        #print(count)
    #print(count)
    if count!=0:
        print("impossible")
    else:
        print("possible")
0