結果
問題 | No.154 市バス |
ユーザー | phtmscg |
提出日時 | 2019-05-13 19:58:56 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
WA
|
実行時間 | - |
コード長 | 584 bytes |
コンパイル時間 | 110 ms |
コンパイル使用メモリ | 10,888 KB |
実行使用メモリ | 7,944 KB |
最終ジャッジ日時 | 2023-09-22 09:40:19 |
合計ジャッジ時間 | 4,274 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 477 ms
7,756 KB |
testcase_01 | AC | 472 ms
7,752 KB |
testcase_02 | AC | 480 ms
7,888 KB |
testcase_03 | AC | 133 ms
7,816 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 450 ms
7,840 KB |
testcase_08 | WA | - |
ソースコード
for _ in range(int(input())): C = input()[::-1] cr,cg,cw = C.count("R"),C.count("G"),C.count("W") if cr == cg and cw >= cr: Q = [0,0] while C: color = C[0] C = C[1:] if color == "R": Q[0] += 1 elif color == "G" and Q[0]>Q[1]: Q[1] += 1 elif color == "G": print("impossible") break elif Q[0]*Q[1]==0 and color == "W": break else: print("possible") else: print("impossible")