結果

問題 No.154 市バス
ユーザー lllllll88938494lllllll88938494
提出日時 2022-06-02 13:11:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 11,864 KB
実行使用メモリ 10,172 KB
最終ジャッジ日時 2023-10-21 01:06:48
合計ジャッジ時間 3,445 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 343 ms
10,172 KB
testcase_01 AC 325 ms
10,172 KB
testcase_02 AC 344 ms
10,172 KB
testcase_03 AC 342 ms
10,172 KB
testcase_04 WA -
testcase_05 AC 26 ms
10,156 KB
testcase_06 AC 25 ms
10,156 KB
testcase_07 AC 356 ms
10,172 KB
testcase_08 AC 26 ms
10,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
#n=1

for i in range(n):
    s=input()
    g=0
    r=0
    w=0
    w2=0
    f=1
    se=set()
    for i in s:
        se.add(i)
        if i == 'W':
            w+=1
            w2+=1
        elif i == 'G':
            g+=1
            w2 = 2
        elif i == 'R':
            r+=1
            w2%=2
        if (g - r) < 0:
            f = 0
                
    if ((g-r) != 0) or (f == 0) or (len(se) == 1) or (len(s) < 3) or (w<g) or (w2!=0):
        #print(((g-r) != 0) , (f == 0) , (len(se) == 1) , (len(s) < 3) , (w<g) , (w2!=0),w2,g,r)
        print('impossible')
    else:
        print('possible')
        
            
0