摘要: 又是LIS,又没看出来,写了一个O(n2),用滚动数组优化的算法,超时,瞥了一眼discuss看到了LIS这个字眼,一想,还果然可转化为LIS,而且还这么明显,居然没看出来#include <iostream>#include <cstdio>#include <algorithm>using namespace std;const int maxn=40000+10;const int inf=200000000;int num[maxn];int f[maxn],d[maxn];int main(){ int n,p; scanf("%d&qu 阅读全文
posted @ 2013-03-14 21:26 LJ_COME!!!!! 阅读(112) 评论(0) 推荐(0)