結果
| 問題 | No.154 市バス |
| コンテスト | |
| ユーザー |
taba
|
| 提出日時 | 2016-04-16 23:55:07 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 268 ms / 2,000 ms |
| コード長 | 320 bytes |
| 記録 | |
| コンパイル時間 | 46 ms |
| コンパイル使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-12-03 20:27:41 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 |
ソースコード
for _ in[0]*input(): s=raw_input() g=r=p=0 for c in s[::-1]: if c=="R": r+=1 elif c=="G": g+=1 if g>r: break elif c=="W": if r>0 and g==0 and p==0: break if g>0 and r>0: r-=1 g-=1 p+=1 #print r,g if g==r and r==0 and s[-1]!="W": print"possible" else: print"impossible"
taba