赞
踩
n=int(input()) nums=list(map(int,input().split())) max_=float('-inf') for i in range (n): for j in range (i+1,n): tmp=abs(i-j)+abs(nums[i]-nums[j]) max_=max(tmp,max_) print(max_)
import os
import sys
n=int(input())
nums=list(map(int,input().split()))
max_len=float('-inf')
count=0
for i in range(n-1):
if nums[i]<nums[i+1]:
count+=1
else:
max_len = max(max_len, count + 1)
count=0
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。