python答案对的但是全都RE,估计是输入有问题,有大佬帮忙看看怎么改吗谢了

P1320 压缩技术(续集版)

lzysxfcs @ 2024-04-11 22:38:10

matrix = []  #储存图阵
while True:
    row = input()
    if row:
        matrix.append(row)
    else:
        break
matrix1 = ''.join(matrix) + 'x'
N = len(matrix[0])
code = []  #储存压缩码
code.append(N)
count =1
for index,char in enumerate(matrix1[:-1]):
    if char == matrix1[index+1]:
        count +=1
    else:
        code.append(count)
        count =1
result = ' '.join(map(str,code))
print(result)

by NC20061226 @ 2024-04-11 22:40:51

这题用python做不了,输入得用C艹


by lzysxfcs @ 2024-04-11 22:43:56

@NC20061226 啊?!!!


|