結果
問題 | No.154 市バス |
ユーザー | AEn |
提出日時 | 2022-05-16 11:17:55 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 440 bytes |
コンパイル時間 | 792 ms |
コンパイル使用メモリ | 87,172 KB |
実行使用メモリ | 77,472 KB |
最終ジャッジ日時 | 2023-10-12 03:21:03 |
合計ジャッジ時間 | 2,260 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | MLE | - |
testcase_01 | MLE | - |
testcase_02 | MLE | - |
testcase_03 | MLE | - |
testcase_04 | MLE | - |
testcase_05 | MLE | - |
testcase_06 | MLE | - |
testcase_07 | MLE | - |
testcase_08 | MLE | - |
ソースコード
def solve(S): r, g, w, = 0, 0, 0 for s in S[::-1]: if s == 'R': r += 1 elif s == 'G': g += 1 if g > r: return False elif g == 0: return False elif w < g: w += 1 return w == g == r T = int(input()) for t in range(T): S = list(input()) if solve(S): print('possible') else: print('impossible')