博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年7月16日

摘要: 题目:http://www.spoj.pl/problems/STONE2/用生成函数的方法,其实也是dp的思想。View Code #include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int mod = 1000000007;const int N = 105;#define M(a) ((a)%mod)#define ll long longll ans, an[N], n, all;ll t1[N*N], t2[N*N], c[N*N][N]; 阅读全文

posted @ 2012-07-16 19:01 紫华弦筝 阅读(243) 评论(0) 推荐(0) 编辑

摘要: 题目:http://poj.org/problem?id=3167题意:给一个模式串,按照模式串的大小对应关系,找出匹配串有相同大小对应关系的子串。利用指针,下标可以直接一一对应。View Code #include <cstdio>#include <cstring>#include <vector>using namespace std;const int N = 100000+10;const int M = 25000+10;int n, k, s, at;int a[N], b[M];int d[30], low[M], high[M], path 阅读全文

posted @ 2012-07-16 11:40 紫华弦筝 阅读(202) 评论(0) 推荐(0) 编辑