結果
| 問題 | No.154 市バス |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-03-22 00:09:56 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 305 ms / 2,000 ms |
| + 43µs | |
| コード長 | 562 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2026-10-12 17:12:29 |
| 合計ジャッジ時間 | 3,767 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
T=int(input())
for tests in range(T):
S=input()
W=0
G=0
R=0
flag=1
lastw=-1
lastg=-1
lastr=-1
for ind in range(len(S)):
s=S[ind]
if s=="G":
G+=1
lastg=ind
elif s=="R":
R+=1
lastr=ind
else:
W+=1
lastw=ind
if G<R:
flag=0
if W<G or W<R:
flag=0
if G==R and flag==1 and lastw<lastr and lastw<lastg and lastg<lastr:
print("possible")
else:
print("impossible")
titia