結果

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

テストケース

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

ソースコード

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 (w-g) < 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