結果
問題 | No.154 市バス |
ユーザー | IJKTanabe |
提出日時 | 2019-09-04 21:39:10 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 557 bytes |
コンパイル時間 | 459 ms |
コンパイル使用メモリ | 10,736 KB |
実行使用メモリ | 7,888 KB |
最終ジャッジ日時 | 2023-08-28 15:29:05 |
合計ジャッジ時間 | 2,374 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 161 ms
7,820 KB |
testcase_01 | AC | 168 ms
7,748 KB |
testcase_02 | AC | 168 ms
7,824 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 15 ms
7,848 KB |
testcase_06 | AC | 16 ms
7,792 KB |
testcase_07 | AC | 166 ms
7,804 KB |
testcase_08 | WA | - |
ソースコード
count = int(input()) result_list = [] for i in range(count): memo = input() result = "possible" green_flg = 0 judge = 0 for char in reversed(memo): if char == 'R': judge += 1 elif char == 'G': green_flg = 1 judge -= 1 if judge < 0: result = "impossible" break else: if green_flg == 0: result = "impossible" break result_list.append(result) for r in result_list: print(r)