結果
問題 | No.154 市バス |
ユーザー |
|
提出日時 | 2021-06-17 09:39:38 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 609 bytes |
コンパイル時間 | 327 ms |
コンパイル使用メモリ | 82,296 KB |
実行使用メモリ | 117,172 KB |
最終ジャッジ日時 | 2025-01-02 11:55:46 |
合計ジャッジ時間 | 2,947 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 MLE * 6 |
ソースコード
t=int(input())sary=[list(input()) for _ in range(t)]from collections import Counterfor s in sary:cs=dict(Counter(s))if "W" not in cs or "G" not in cs or "R" not in cs:print("impossible")continueif cs["R"]!=cs["G"] or cs["R"]>cs["W"]:print("impossible")continueflg=Truecounter={"W":0,"G":0,"R":0}for x in s:counter[x]+=1if counter["W"]>=counter["G"]>=counter["R"]:passelse:flg=Falsebreakif counter["G"]==cs["G"] and x=="W":flg=Falsebreakif flg:print("possible")else:print("impossible")