摘要: 好吧 竟然因为编译器的问题不过 到底有什么区别 ????可以推出公式Hi = (i-1)H2 +(i-1)(i-2)-(i-2)*H1 因为所有的Hi都要大于零 Hn要最小 即存在Hi=0 即求H2可以达到的最大值 代入公式求出Hn#include #include #include #define... 阅读全文
posted @ 2013-08-02 12:41 xlc2845 阅读(116) 评论(0) 推荐(0)
摘要: 简单的dp 但是一个大数加法 套用了末位大牛的类模板#include #include #include #define maxs 10005#define maxn 110using namespace std;char X[maxs], Z[maxn];struct bign{ int l... 阅读全文
posted @ 2013-08-01 19:50 xlc2845 阅读(114) 评论(0) 推荐(0)
摘要: 这个......小学生就会的 坑在输入输出了 两个数之间可能不止一个空格....wa了好几遍啊#include #include #include using namespace std;int g[1130][1130],dp[1130][1130];char str[1130];int main... 阅读全文
posted @ 2013-08-01 19:11 xlc2845 阅读(101) 评论(0) 推荐(0)
摘要: 数据量小 dfs水过#include #include #include using namespace std;struct pp{ int x,y; void f(int a, int b) { x = a; y = b; }};int vis... 阅读全文
posted @ 2013-08-01 13:29 xlc2845 阅读(104) 评论(0) 推荐(0)
摘要: 不能简单模拟(会超时) 运用一点小技巧 减少时间复杂度#include #include using namespace std;int a[200010];int cc[200010];int main(){ int t,n,m,tt; scanf("%d",&t); memse... 阅读全文
posted @ 2013-08-01 13:28 xlc2845 阅读(144) 评论(0) 推荐(0)
摘要: 好牛的题 哈哈#include #include #define S(n) scanf("%d",&n)#define F(i,n) for(int i=1;i<=n;i++)using std::max;int a[110][110],T,m,n,f;main(){S(T);F(b,T){m=0;... 阅读全文
posted @ 2013-07-31 21:22 xlc2845 阅读(103) 评论(0) 推荐(0)
摘要: 一开始WA了 参考了一下 求正反两个方向的最长上升子序列 并分别记录在两个数组中 最后求最大值#include #include #include #include using namespace std;int a[10010],c1[10010],c2[10010],d[10010];int ... 阅读全文
posted @ 2013-07-31 16:49 xlc2845 阅读(130) 评论(0) 推荐(0)
摘要: 与108类似 多加了两层循环 水过#include #include #include #include #include #define maxn 110using namespace std;int a[maxn][maxn];int b[maxn];int main(){ int t; ... 阅读全文
posted @ 2013-07-31 15:52 xlc2845 阅读(132) 评论(0) 推荐(0)
摘要: 背包问题 总时间为容量,单个唱片时间为各个物体的价值与体积 f【】 用来记录路径#include #include #define M 10005int a[25],d[M],f[25][M];int main(){ int V; while(scanf("%d",&V) == 1) ... 阅读全文
posted @ 2013-07-31 15:48 xlc2845 阅读(95) 评论(0) 推荐(0)
摘要: 降维 枚举行累加 然后求单行上最大连续和#include #include #include #include #include #define maxn 110using namespace std;int a[maxn][maxn];int b[maxn];int main(){ int... 阅读全文
posted @ 2013-07-31 15:32 xlc2845 阅读(91) 评论(0) 推荐(0)