結果

問題 No.154 市バス
ユーザー quaspinSWquaspinSW
提出日時 2017-04-14 01:47:38
言語 PyPy2
(7.3.15)
結果
MLE  
実行時間 -
コード長 508 bytes
コンパイル時間 1,427 ms
コンパイル使用メモリ 76,420 KB
実行使用メモリ 79,024 KB
最終ジャッジ日時 2024-04-21 10:15:00
合計ジャッジ時間 2,446 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#!/usr/bin/env python

num = int(raw_input())
for i in range(num):
    str = raw_input()
    show = list(str)
    red = 0
    green = 0
    white = 0
    length = len(str)
    for j in range(length):
        if show[length - 1 - j] == "R":
            red += 1
        elif show[length - 1 - j] == "G":
            green += 1
        else:
            white += 1

        if red < green:
            break
    if red ==  green and white >= red:
        print("possible")
    else:
        print("impossible")
0