- 博客(21)
- 资源 (6)
- 收藏
- 关注
原创 bzoj4032: [HEOI2015]最短不公共子串
从网上搜题解都是后缀自动机然而本蒟蒻不会后缀自动机,只好乱搞第一个问题对B建trie跑就好第二个问题可以枚举子串第三个问题可在B串的trie上dfs,具体见代码第四个问题用f[i][j]表示在A中前i个字符选j个(一定包含i)在B中匹配到的最小位置,裸dp是O(n^3),加一些优化可以到O(26*n^2)另外bzoj上只给了256M内存,我如果trie和用于dp优化的数组同
2015-05-21 10:56:24
1392
原创 [Ctsc2004]公式编辑器
又是模拟题,用c++类乱搞一通#include #include #include #include using namespace std;char **ans;struct Base{ int height, width, middle; Base *father, *next, *last; Base(Base *fa); virtual str
2015-04-17 10:33:48
1218
原创 bzoj3155: Preprefix sum
我们考虑把一个数字加某个值a1 a2 a3 a4 a5a6+ts1 s2 s3s4s5 s6+t +t+t+tss1 ss2 ss3 ss4 ss5 ss6+t +2t+3t+4t设d[i]表示从i开始ss[i]依次加d[i],d[i]*2,d[i]*3....d[i]对于ss[n]的贡献为d[i]*(n-i+1)设原数组为org
2014-12-23 14:47:27
747
原创 bzoj 2120: 数颜色
莫队水过每次修改之间的询问yong#include #include #include #include #include using namespace std;#define MAXN 100003#define MAXQ 100003int n, a[MAXN], sqrtn;struct Qtype{ int num; char opt;
2014-09-13 20:40:43
634
原创 bzoj2038: [2009国家集训队]小Z的袜子(hose)
莫队算法#include #include #include #include using namespace std;#define MAXN 50003#define MAXM 50003int sqrtn;struct qtype{ int l, r, nu; bool operator< (const qtype &x)const {
2014-09-01 21:59:32
692
原创 bzoj1091: [SCOI2003]切割多边形
暴力+几何注意一个很坑的地方,只#include #include #include using namespace std;#define EPS (1e-6)#define MAXP 10int dcmp(double a, double b = 0){ if (fabs(a - b) <= EPS) return 0; return
2014-07-12 12:45:40
852
原创 bzoj3109: [cqoi2013]新数独
水暴搜……/www.lydsy.com/JudgeOnline/problem.php?id=3109
2014-06-03 20:23:23
1121
原创 bzoj1033: [ZJOI2008]杀蚂蚁antbuster
刚开博客,放几道大模拟杀蚂蚁www.lydsy.com/JudgeOnline/problem.php?id=1033
2014-06-02 20:41:08
1738
原创 bzoj1972: [Sdoi2010]猪国杀
#include #include #include #include #include using namespace std;#define MAXM 2001#define Tao ('P')#define Sha ('K')#define Shan ('D')#define JueDou ('F')#define NanZhu ('N')
2014-06-02 20:37:46
2400
GNU Source-highlight for windows
2014-12-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人