求大佬帮忙看下为什么结果全是re

P1319 压缩技术

hyb569789 @ 2025-01-10 19:57:25

s = input()

ol = list(map(int,s.split(" ")))

n = ol[0]

lis = []

for i in range(1,len(ol)):

if i%2==1:
    for j in range(1,ol[i]+1):
        lis.append(0)
else:
    for j in range(1,ol[i]+1):
        lis.append(1)

for i in range(1,len(lis)+1):

if i%n==0:
    print(lis[i-1])
else:
    print(lis[i-1],end=" ")

|