結果
問題 | No.154 市バス |
ユーザー |
![]() |
提出日時 | 2015-02-18 03:20:53 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 590 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 76,288 KB |
最終ジャッジ日時 | 2024-10-13 06:45:34 |
合計ジャッジ時間 | 2,084 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 MLE * 6 |
ソースコード
t = int(input()) ans = [] for i in range(t): s = list(input()) f = 0 flag = 1 count = 0 count_w = 0 count_g = 0 count_r = 0 while(s): wgr = s.pop(0) if wgr == 'W': count_w += 1 flag = 1 elif wgr == 'G': count_g += 1 flag = 0 elif wgr == 'R': count_r += 1 if count_g < count_r: f = 1 if f == 0 and flag == 0 and count_w >= count_g == count_r: ans.append('possible') else: ans.append('impossible') for j in ans: print(j)