結果
| 問題 |
No.154 市バス
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-03-05 23:04:36 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 369 bytes |
| コンパイル時間 | 94 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-18 01:41:47 |
| 合計ジャッジ時間 | 2,098 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 5 WA * 3 |
ソースコード
T = int(input())
for _ in range(T):
S = list(input())
cnt = 0
flag = 1
for s in S:
if s == "G":
cnt += 1
elif s == "R":
cnt -= 1
if cnt < 0:
print("impossible")
flag = 0
break
if flag == 0:
continue
print("possible") if cnt == 0 else print("impossible")
rlangevin