用贪心简单证明之后就是一个从两头取的动态规划 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; const int maxn=1e3+9; int a[maxn],b[maxn]; int dp[maxn][maxn]; bool cmp(int a,int b) { return a>b; } int m…
Longest Ordered Subsequence Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 42914 Accepted: 18914 Description A numeric sequence of ai is ordered if a1 < a2 < - < aN. Let the subsequence of the given numeric sequence (a1, a2, -, aN) be…