摘要:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=524LCS 细节View Code #include <iostream>#include <cstdio>#include <vector>#include <cmath>#include <set>#include <map>#include <queue>#include <string>#include <cstring>#include <algorit 阅读全文
摘要:
View Code /*==================================================*\| 最长有序子序列(递增/递减/非递增/非递减)\*==================================================*/const int N = 1001;int a[N], f[N], d[N]; // d[i]用于记录a[0...i]的最大长度int bsearch(const int *f, int size, const int &a) { int l=0, r=size-1; while( l <= r ) 阅读全文
摘要:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3523ZOJ 求使无序的序列变有序的最小花费, LIS, struct 初始化需要特别注意View Code #include <iostream>#include <cstdio>#include <cstring>#include <string>#include <algorithm>int f_min(int x,int y) {if(x<y)return x;else return y;}int 阅读全文