結果

問題 No.154 市バス
ユーザー kyo1kyo1
提出日時 2020-09-04 13:16:39
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 8,032 KB
最終ジャッジ日時 2023-08-16 18:36:57
合計ジャッジ時間 2,539 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
7,956 KB
testcase_01 AC 173 ms
7,716 KB
testcase_02 AC 170 ms
7,784 KB
testcase_03 AC 174 ms
7,932 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 180 ms
7,896 KB
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    S = input()
    a = 0
    f = True
    for s in S:
        if s == "G":
            a += 1
        if s == "R":
            a -= 1
        if a < 0:
            f = False
    if not f or a != 0:
        print("impossible")
    else:
        print("possible")
0