08 2014 档案

摘要:第一次写区间合并的题目,实在有点棘手,就顺着TK学长的思路敲了一编代码,但还是磕磕绊绊的,继续敲一道区间合并的题吧#include #define size 500010#define Lson (xb?a:b;}void buildtree(int rt,int L,int R){ flag... 阅读全文
posted @ 2014-08-08 16:23 TK在颤抖 阅读(268) 评论(0) 推荐(0)
摘要:各种错误都尝试过了,最终是没有考虑多组数据#include#include#include#include#include#define size 600100using namespace std;int sum[size],ret =0;void buildtree(int rt,int L,i... 阅读全文
posted @ 2014-08-07 12:11 TK在颤抖 阅读(132) 评论(0) 推荐(0)
摘要:数组开小了,还是小了很多,注意数组里的是节点总数!#include#include#include#include#include#define maxn 500000+10using namespace std;int ch[maxn][26],fail[maxn],last[maxn],val[... 阅读全文
posted @ 2014-08-05 14:31 TK在颤抖 阅读(606) 评论(0) 推荐(0)
摘要:字典树的应用题目,虽然照模板就能打出来,但是看着学长的代码,学会了sscanf的用法,sscanf(str,"%s%s",a,b)把str分成a和b两个字符串,分隔符为空格#include#include#include#include#includeusing namespace std;int ... 阅读全文
posted @ 2014-08-04 15:24 TK在颤抖 阅读(240) 评论(0) 推荐(0)
摘要:没有用到懒惰标记的线段树问题,不过通过这道题找到了不用数组就能找到写update的方法了#include#include#include#include#includeusing namespace std;#define max 50010#define INF 0x3f3f3f3fint tre... 阅读全文
posted @ 2014-08-01 16:05 TK在颤抖 阅读(438) 评论(0) 推荐(0)