結果
問題 |
No.154 市バス
|
ユーザー |
![]() |
提出日時 | 2024-01-05 00:18:58 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 571 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 81,860 KB |
実行使用メモリ | 76,704 KB |
最終ジャッジ日時 | 2024-09-27 18:54:22 |
合計ジャッジ時間 | 1,979 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 MLE * 6 |
ソースコード
for j in range(int(input())): #print(j) W,R,G = 0,0,0 lastw = 0 lastg = 0 S = input() for i,s in enumerate(S): if s == "W": W += 1 lastw = i if s == "R": R += 1 if s == "G": G += 1 lastg = i if W < G or G < R: print("impossible") break else: if lastw > lastg: print("impossible") continue if R == G and R > 0: print("possible") else: print("impossible")