题解 | #编排字符串#用双端队列就行
编排字符串
https://www.nowcoder.com/practice/42c0673f04b34f66ae236a1cb7995532
from collections import deque dq = deque() for _ in range(int(input())): dq.append(input()) if len(dq) > 4: dq.popleft() for i in range(-1, -len(dq) - 1, -1): print(f'{-i}={dq[i]}', end=' ') print()