上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 37 下一页
摘要: 1 #include <stdio.h> 2 #include <cstring> 3 #include <iostream> 4 #include <string> 5 #include <algorithm> 6 #include <queue> 7 #include <vector> 8 #include <math.h> 9 #include <map> 10 11 #define LL 阅读全文
posted @ 2019-09-04 09:24 _Ackerman 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problem/P3373 讲讲优先级的问题: 1. 加法和乘法顺序不一样会导致不同的结果 比如: (a+b)c 不等于 ac + b 而在记录懒标记的时候,加法和乘法两种标记放到一起,并不知道哪个先,哪个后。 所以要确定一个优先级 我们分析一下 阅读全文
posted @ 2019-09-03 22:14 _Ackerman 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problem/P2590 注意这题有负权。 (不然你就只能跑10分!) 阅读全文
posted @ 2019-09-03 16:17 _Ackerman 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problem/P3833 阅读全文
posted @ 2019-09-02 21:28 _Ackerman 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 二维ST表 既然查询对象是个二维矩阵,那么我们能不能维护一个二维的ST STST表呢?答案显然是肯定的。 预处理:我们让 dp[i][j][k][l] 为新的ST表,表示以 (i,j) 为左上角,右下角为 (i + 2^k -1 , j + 2^l - 1) 的矩阵中的最大值,那么我们可以看出预处理 阅读全文
posted @ 2019-08-21 10:07 _Ackerman 阅读(951) 评论(0) 推荐(0) 编辑
摘要: 划分树,类似线段树,主要用于求解某个区间的第k 大元素(时间复杂度log(n)),快排本也可以快速找出,但快排会改变原序列,所以每求一次都得恢复序列。 什么是划分树? 划分树是一种基于线段树的数据结构,也利用了分治的思想,却比线段树高效很多,这是为什么?因为划分树又多了一个性质:在划分时不是随意划分 阅读全文
posted @ 2019-08-20 22:09 _Ackerman 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://vjudge.net/problem/POJ-2777 题意: 有L个画板,30种颜色,o个操作:P a b :询问a-b 种有多少种颜色不同的,C a b c:把a-b全部涂成c的颜色(覆盖掉) 阅读全文
posted @ 2019-08-20 10:05 _Ackerman 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/558/B 题意: 一个序列的美丽程度与其中某个数重复次数的最大值有关。求最短的子序列(连续的一段)使得其美丽程度与原序列相等。 阅读全文
posted @ 2019-08-18 11:38 _Ackerman 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1096/D 题意: 现在有一个由小写字母组成的字符串,去掉这个字符串的第i个位置会有a[i]的代价,问去掉一些字符使得该字符串中不包含一个子序列为hard的最小代价和。 思路: 这题一看就是一个 dp 的问 阅读全文
posted @ 2019-08-18 09:52 _Ackerman 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1082/A 题意: 有一本书,页码是1到n。当前页的页码是x,要翻到第y页。规定:每次只能翻d页,向前向后翻均可。注:翻向第一页或者翻向最后一页的翻页操作可以无视上述规定。 思路: 这题其实就一个简单的模拟 阅读全文
posted @ 2019-08-18 09:42 _Ackerman 阅读(240) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 37 下一页