这是一道高精题,我用了 python。输入格式为第一行两个整数,第二行一个字符串,代码如下:
a,b = map(int,input().split()) s = ' '+input()
然而这份代码会挂掉 404040 分,调了很久之后发现必须改成这样(把读到的 \r 删了)才能过:
\r
a,b = map(int,input().split()) s = ' '+input().replace('\r','')
请问有没有大佬知道原因,是否是因为输入数据中有多余字符?