测试数据中,序列中的每个数字占一行,而非如题目中所说的"第二行n个整数"。 故输入时不能用
arr=list(map(int,input().split()))
而是采用循环
arr=[] for i in range(n): arr.append(int(input()))