結果
問題 | No.154 市バス |
ユーザー | ayaoni |
提出日時 | 2020-11-27 14:20:23 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 486 bytes |
コンパイル時間 | 290 ms |
コンパイル使用メモリ | 87,224 KB |
実行使用メモリ | 77,376 KB |
最終ジャッジ日時 | 2023-10-01 04:11:06 |
合計ジャッジ時間 | 2,649 ms |
ジャッジサーバーID (参考情報) |
judge12 / 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 | - |
ソースコード
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')