题解 | #合唱队#
合唱队
http://www.nowcoder.com/practice/6d9d69e3898f45169a441632b325c7b4
def DPPPPPPPPPP(l):
LIS=[1]*len(l)
for i in range(1,len(l)):
for j in range(i):
if l[i]>l[j]:
LIS[i]=max(LIS[i],LIS[j]+1)
return LIS
while True:
try:
num = int(input())
stu_list = list(map(int,input().split()))
count=[]
left = DPPPPPPPPPP(stu_list)
right = DPPPPPPPPPP(stu_list[::-1])[::-1]
for i in range(len(left)):
count.append(left[i]+right[i]-1)
print(num-max(count))
except:
break