思路:最长上升子序列 正着做一遍 倒着做一遍 然后 取最大值 #include<bits/stdc++.h> using namespace std; const int maxn=105; int dp[maxn],dp1[maxn],a[maxn]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++)scanf("%d",&a[i]); for(int i=1;i<=n;i++){ dp[i]…
水题 #include <bits/stdc++.h> using namespace std; const int maxn = 105; int main(int argc, char const *argv[]) { int n; cin >> n; int high[maxn]; for(int i = 1; i <= n; i++) cin >> high[i]; int f[maxn] = {0}; int g[maxn] = {0}; int ans…