n, m = (int(x) for x in input().split())
ops = [int(x) for x in input().split()]
def solve(ops, n):
from collections import deque, Counter
nums1 = list(range(1, n + 1, 2))
nums2 = list(range(2, n + 1, 2))
print(*nums1)
print(*nums2)
q0 = deque(nums1)
q1 = deque(nums2)
left = 0
q = [q0, q1]
for op in ops:
if op == 1:
val = q[left].popleft()
q[left].append(val)
left = 1 - left
q_left = q[left]
q_right = q[1 - left]
for i in range(len(q0)):
print(q_left[i], end = ' ')
print(q_right[i], end = ' ')
solve(ops, n)
做出来了却没空提交,做前面猿辅导用了一个小时,烦。
全部评论
(4) 回帖