0最大距离 - 蓝桥云课 (lanqiao.cn)
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_)
0最长递增 - 蓝桥云课 (lanqiao.cn)
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