大佬能来看看为什么RE吗

P1319 压缩技术

零贰幺_lingeryao @ 2022-01-14 22:42:46

text = input()

text = text.split(' ')

output = ''

i = 1

kk = '1'

number = 0

for k in range(len(text) - 1):

if kk == '0':

    for j in range(int(text[i])):output = output + '1'
    kk = '1'

else:

    for j in range(int(text[i])):output = 
    output + '0'

    kk = '0'

i += 1

l = '' list_1 = []

for i in output:list_1.append(i)

for i in range(int(text[0])):list_1.insert(i*8, '\n')

for i in list_1:l = l + i

print(l)


by qwq___qaq @ 2022-01-14 23:53:45

@零贰幺_lingeryao 希望更丰富的展现?使用Markdown

看不懂


by 零贰幺_lingeryao @ 2022-01-16 12:03:04

@_sto_pengzijunorz

text = input()
text = text.split(' ')
output = ''
i = 1
kk = '1'
number = 0
for k in range(len(text) - 1):
    if kk == '0':
        for j in range(int(text[i])):output = output + '1'
        kk = '1'
    else:
        for j in range(int(text[i])):output = output + '0'
        kk = '0'
    i += 1
l = ''
list_1 = []
for i in output:list_1.append(i)
for i in range(int(text[0])):list_1.insert(i*(int(text[0]) + 1), '\n')
for i in list_1:l = l + i
print(l)

|