1 1 0.7 0.2 0.8 第 3 题感觉要滑动窗口加建树  第 4 题调了半天没过,白嫖 然后最后30分钟想到思路了没写出来 第 5 题没用缓存只过了0.8,难顶  时间都去做第4题了 ```python from collections import defaultdict n,m = list(map(int,input().strip().split(' &(5528)#39;))) weigh = list(map(int,input().strip().split(' &(5528)#39;))) weigh = [0]+weigh memo = defaultdict(list) for i in range(m):     x1,x2= list(map(int,input().strip().split(' &(5528)#39;)))     memo[x1].append(x2)     memo[x2].append(x1) res =[0] memodict = {} def dfs(node,lengh):     if node in memodict:         return memodict[node]     ans = 1     for i in memo[node]:         if weigh[i]<weigh[node]:             tmp = dfs(i,lengh+1)+1             ans = max(ans,tmp)     memodict[node] = ans     return ans for i in range(1,n+1):     res = max(dfs(i,1),res) print(res[0]) ``` 这是考完写的有缓存版