-
个人简介
#include<bits/stdc++.h> using namespace std; int n,a[110],f[110]; int dfs(int x){ if(x==n){ return 1; } if(f[x]!=-1){ return f[x]; } int maxn=1; for(int i=x+1;i<=n;i++){ if(a[x]>a[i]){ maxn=max(maxn,1+dfs(i)); } } return f[x]=maxn; } int main(){ memset(f,-1,sizeof(f)); cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } cout<<dfs(1); }
-
通过的题目
-
最近活动
This person is lazy and didn't join any contests or homework. -
最近编写的题解