求大佬看看为什么RE啊啊

P1319 压缩技术

零贰幺_lingeryao @ 2022-12-25 13:54:23

inp = input()
n = inp.split(" ")[0]
sc = inp.split(" ")[1:len(inp)]
str_ = ""
num = False
def cut(obj, sec):
    return [obj[i:i+sec] for i in range(0,len(obj),sec)]

for i in sc:
    for j in range(int(i)):
        str_ = str_ + str(int(num))
    num = not num
i = 0
ans = cut(str_, int(n))
for i in ans:
    print(i)

by ht__QAQ__ @ 2022-12-27 17:54:44

@零贰幺_lingeryao 在input()之后添加.strip()


by 零贰幺_lingeryao @ 2022-12-27 23:53:58

@zzzhhhzzz 可以了!谢谢大佬!


|