上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 83 下一页
摘要: 题目链接 "loj 2012. 「SCOI2016」背单词" 题解 题面描述有点不清楚. 考虑贪心 type1的花费一定不会是优的,不考虑, 所以先把后缀填进去,对于反串建trie树, 先填父亲再填儿子,这样每个单词的后缀填完了才会被填。 不是单词结束点的点是没用的,去掉 根据直觉,填单词和dfs序 阅读全文
posted @ 2018-08-31 16:58 zzzzx 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 简单写一下吧 emmmm,来晚了1h,没赶上,所以没交.......(捂脸 T1 开始读错题了诶 开烤1.2h后 发现是个傻逼题.... 排序一下,维护前缀最左,右端点 随机数据我跑的比他们都慢.......... c++ include include define LL long long co 阅读全文
posted @ 2018-08-30 20:01 zzzzx 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 估分 大佬们都去写题解了,我不写可能会被老师训诶.... 预计分数:100 + 100 + 5 + 100 + 25 + 100 = 430 实际 :80 + 100 + 0 + 100 + 25 + 25 = 325 心路历程 dAY1 T1 wocT1这么鬼畜,1h后不会做... 上个厕所 然后 阅读全文
posted @ 2018-08-27 21:18 zzzzx 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "codeforces895E. Eyes Closed" 题解 线段树维护期望和 写出修改两区间的相互影响 就是一个区间修改 emmm考试的代码过不去,这么松的spj都过不去Orz,每次和答案差0.001 ans左右... 可能是我每次直接对区间暴力统计右区间的影响,然后直接打个修改区间 阅读全文
posted @ 2018-08-26 20:28 zzzzx 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj1491: [NOI2007]社交网络" 题解 n^3枚举一下就没了... 代码 c++ include include include inline int read() { int x = 0,f = 1 ; char c = getchar(); while(c '9')c 阅读全文
posted @ 2018-08-23 21:29 zzzzx 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "CF915E Physical Education Lessons" 题解 动态开点线段树 代码 c++ / 动态开点线段树 / include include include inline int read() { int x = 0,f = 1; char c = getchar() 阅读全文
posted @ 2018-08-23 19:22 zzzzx 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj4407: 于神之怒加强版" 题解 求这个东西 $$\sum_{i=1}^n\sum_{j=1}^m\gcd(i,j)^k$$ 然后是套路 $$ \begin{aligned}\sum_{i=1}^n\sum_{j=1}^m\gcd(i,j)^k &=\sum_{d=1}^{mi 阅读全文
posted @ 2018-08-23 19:19 zzzzx 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj4337: BJOI2015 树的同构" 题解 树哈希的一种方法 对于每各节点的哈希值为hash[x] = hash[sonk[x]] p[k]; p为素数表 代码 阅读全文
posted @ 2018-08-23 19:01 zzzzx 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "51nod 1277 字符串中的最大值" 题解 对于单串,考虑多串的fail树,发现next数组的关系形成树形结构 建出next树,对于每一个前缀,他出现的次数就是他子树的大小 代码 c++ include include include inline int read() { int 阅读全文
posted @ 2018-08-22 21:57 zzzzx 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj2434: [Noi2011]阿狸的打字机" 题解 建出fail树,如果fail树中只有第y个字符串那就是求x串这个点的子树和 对于每组询问的y分类 我们可以重新进行一次建树一样的操作,每次dfs的到字符串y 只要在fail树上用dfs序+树状数组维护,每次把路径上的点插到bit 阅读全文
posted @ 2018-08-22 21:54 zzzzx 阅读(143) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 83 下一页