結果
| 問題 |
No.154 市バス
|
| コンテスト | |
| ユーザー |
zakuro9715
|
| 提出日時 | 2016-06-19 23:15:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 588 bytes |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,572 KB |
| 最終ジャッジ日時 | 2024-10-13 08:32:42 |
| 合計ジャッジ時間 | 10,532 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | AC * 5 WA * 2 TLE * 1 |
ソースコード
def delete_before(s, c, n):
for i in range(n - 1, -1, -1):
if s[i] == c:
s[i] = '#'
return True
return False
T = int(input())
for t in range(T):
S = list(input())
if S[-1] != 'R':
print('impossible')
continue
for i, c in enumerate(S):
if c == 'G':
if not delete_before(S, 'W', i):
print('impossible')
break
if c == 'R':
if not delete_before(S, 'G', i):
print('impossible')
break
else:
print('possible')
zakuro9715