結果
問題 |
No.154 市バス
|
ユーザー |
![]() |
提出日時 | 2020-11-27 14:20:23 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 486 bytes |
コンパイル時間 | 296 ms |
コンパイル使用メモリ | 82,272 KB |
実行使用メモリ | 75,904 KB |
最終ジャッジ日時 | 2024-07-23 21:35:56 |
合計ジャッジ時間 | 1,847 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 2 MLE * 6 |
ソースコード
import sys def I(): return int(sys.stdin.readline().rstrip()) def S(): return sys.stdin.readline().rstrip() T = I() for _ in range(T): U = S()[::-1] r,g,w = 0,0,0 for u in U: if u == 'R': r += 1 elif u == 'G': g += 1 else: w += 1 if r < g: print('impossible') break else: if r != g or w < r: print('impossible') else: print('possible')