数据结构
八百标兵奔北坡666
这个作者很懒,什么都没留下…
展开
-
D.温暖的签到题(线段树 区间修改)
温暖的签到题 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 65536K,其他语言131072K 64bit IO Format: %lld 题目描述 给你一个长度为n的序列,初始为1,2,3…n,对其进行m次操作。 操作有两种: 1 l r 表示将区间[l,r]用 [1,2…r-l+1] 覆盖 2 l r 查询[l,r]的区间和 输入描述: 第一行包含2个数字,n,m(1 &...原创 2019-05-13 19:59:01 · 173 阅读 · 0 评论 -
codeforces 86 D. Powerful array(普通莫队)
D. Powerful array An array of positive integers a1, a2, …, an is given. Let us consider its arbitrary subarray al, al + 1…, ar, where 1 ≤ l ≤ r ≤ n. For every positive integer s denote by Ks the numbe...原创 2019-05-14 23:20:21 · 194 阅读 · 0 评论 -
2019杭电多校第四场 K-th Closest Distance (主席树 二分)
K-th Closest Distance Time Limit: 20000/15000 MS (Java/Others)Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2524Accepted Submission(s): 910 Problem Description You have...原创 2019-08-02 18:47:50 · 222 阅读 · 0 评论 -
HDU - 1247 Hat’s Words (字典树变形)
A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictionary. Input Standard input consists of a...原创 2019-07-25 21:09:44 · 251 阅读 · 0 评论 -
2019杭电多校第九场 1002 Rikka with Cake(树状数组+离散化)
题意:在一个矩形中有若干条平行坐标轴的直线 ,求将矩形分成多少块。 分析:根据离散数学公式可以推出分成的区域就是k条直线的交点数+1,将问题转化 先将坐标离散化 然后对于其中为L方向的点加入树状数组, 依次枚举每各点的坐标 如果方向向上 则查询树状数组后缀和 若向下 查询前缀和 若向左则将树状数组的这个点删去 因为此后他不在贡献 若向右再加入树状数组 贡献一直到结尾位置 //http://acm....原创 2019-08-20 16:25:53 · 196 阅读 · 0 评论