![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
-------数据结构-------
文章平均质量分 88
CrossDolphin
青春看起来如此完美,没空闲去浪费时间。
展开
-
c++链表(写个例子证明一些知识点,太久没写忘光了)
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<string>#include<vector>#include <ctime>#include<queue>#include&l...原创 2020-02-21 02:05:20 · 243 阅读 · 0 评论 -
hdu 5877 线段树+离散化+DFS
链接:戳这里Weak PairTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionYou are given a rooted tree of N nodes, labeled from 1 to N原创 2016-09-10 22:42:34 · 1601 阅读 · 5 评论 -
hdu 5875 单调栈+离线
链接:戳这里FunctionTime Limit: 7000/3500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionThe shorter, the simpler. With this problem, you should be c原创 2016-09-10 21:20:16 · 1008 阅读 · 0 评论 -
codevs 3044 线段树+离散化+扫描线 (矩形面积并
链接:戳这里3044 矩形面积求并 时间限制: 1 s 空间限制: 256000 KB 题目等级 : 钻石 Diamond 题解题目描述 Description输入n个矩形,求他们总共占地面积(也就是求一下面积的并)输入描述 Input Description可能有多组数据,读到n=0为止(不超过15组)每组数据第一行一个数n,表示矩原创 2016-08-08 15:06:01 · 390 阅读 · 0 评论 -
hdu 5722 线段树+扫描线
链接:戳这里JewelryTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionAfter all the difficulties, Psyche and Cupid are finally gett原创 2016-09-09 11:28:51 · 304 阅读 · 0 评论 -
hdu 1255 线段树+离散化+扫描线 (矩形面积交
链接:戳这里覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.Input输入数据的第一行是一个正整数T(1原创 2016-08-06 18:37:54 · 359 阅读 · 0 评论 -
poj 1151 线段树+离散化+扫描线 (矩形面积并
链接:戳这里AtlantisTime Limit: 1000MS Memory Limit: 10000KDescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts e原创 2016-08-06 15:11:43 · 401 阅读 · 0 评论 -
hdu 5792 离散化+树状数组
链接:戳这里World is ExplodingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionGiven a sequence A with length n,count how many quad原创 2016-08-02 21:27:48 · 1140 阅读 · 6 评论 -
hdu 2586 LCA
链接:戳这里How far away ?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionThere are n houses in the village and some bidirection原创 2016-08-01 20:12:23 · 402 阅读 · 0 评论 -
Codeforces Round #294 (Div. 2) E 树上倍增lca
链接:戳这里E. A and B and Lecture Roomstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA and B are preparing themselves for programmi原创 2016-08-01 19:04:46 · 538 阅读 · 0 评论 -
Codeforces Round #337 (Div. 2) D (矩形面积并
链接:戳这里D. Vika and Segmentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVika has an infinite sheet of squared paper. Initial原创 2016-08-10 19:02:55 · 466 阅读 · 0 评论 -
hdu 5869 RMQ+二分+离线树状数组
链接:戳这里Different GCD Subarray QueryTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionThis is a simple problem. The teacher give原创 2016-09-12 22:21:39 · 451 阅读 · 0 评论 -
hdu 5828 线段树
链接:戳这里Rikka with SequenceTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying原创 2016-08-11 23:03:21 · 691 阅读 · 0 评论 -
Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) C 并查集
链接:戳这里C. Destroying Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array consisting of n non-negative in原创 2016-10-07 21:57:22 · 377 阅读 · 0 评论 -
Codeforces Round #376 (Div. 2) C 并查集
链接:戳这里C. Sockstime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputArseniy is already grown-up and in原创 2016-10-17 20:24:05 · 632 阅读 · 0 评论 -
hdu 5091 线段树+扫描线思想
链接:戳这里Beam CannonTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionRecently, the γ galaxies broke out Star Wars. Each planet i原创 2016-10-13 19:51:22 · 429 阅读 · 0 评论 -
hdu 5820 可持久化线段树
链接:戳这里LightsTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Problem DescriptionToday is April 1st, 2100. Now Guangzhou is a very very big city. Sin原创 2016-09-08 19:26:19 · 563 阅读 · 0 评论 -
hdu 4348 可持久化线段树(区间和
链接:戳这里To the moonTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionBackgroundTo The Moon is a independent game released in N原创 2016-08-15 14:24:52 · 903 阅读 · 0 评论 -
bzoj 3524 可持久化线段树(统计区间数值出现次数
链接:戳这里3524: [Poi2014]CouriersTime Limit: 20 Sec Memory Limit: 256 MB[Submit][Status][Discuss]Description给一个长度为n的序列a。1≤a[i]≤n。m组询问,每次询问一个区间[l,r],是否存在一个数在[l,r]中出现的次数大于(r-l+1)/原创 2016-08-13 21:33:41 · 2309 阅读 · 0 评论 -
hdu 4417 可持久化线段树 (区间<=x的数的数量
链接:戳这里Super MarioTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionMario is world-famous plumber. His “burly” figure and amazi原创 2016-08-13 18:39:04 · 1106 阅读 · 0 评论 -
hdu 4092 线段树
链接:戳这里Nice boatTime Limit: 30000/15000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Problem DescriptionThere is an old country and the king fell in love with a原创 2016-08-11 23:59:04 · 491 阅读 · 0 评论 -
Codeforces Round #365 (Div. 2) D 线段树+离线 (区间内的数有哪些
链接:戳这里D. Mishka and Interesting sumtime limit per test3.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Mishka enjoys programming. Since h原创 2016-08-05 04:48:52 · 555 阅读 · 0 评论 -
Educational Codeforces Round 15 E 树上倍增 RMQ思想
链接:戳这里E. Analysis of Pathes in Functional Graphtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given a functional grap原创 2016-08-01 15:31:56 · 424 阅读 · 0 评论 -
Codeforces Round #305 (Div. 2) D 栈
链接:戳这里D. Mike and Feettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike is the president of country What-The-Fatherland. There原创 2016-07-20 21:10:31 · 239 阅读 · 0 评论 -
hdu 1556 lazy线段树
链接:戳这里Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15159 Accepted Submission(s): 7546Problem Descripti原创 2016-04-14 20:18:58 · 290 阅读 · 0 评论 -
hdu 1698 Just a Hook lazy线段树
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for原创 2016-04-13 21:56:36 · 310 阅读 · 0 评论 -
hdu 5249 KPI 离线+树状数组求第k大
链接:戳这里KPITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description你工作以后, KPI 就是你的全部了. 我开发了一个服务,取得了很大的知名度。数十亿的请求被推到一个大管道后同时服原创 2016-03-26 16:46:34 · 355 阅读 · 0 评论 -
Poj 2985 树状数组求第k大
链接:戳这里The k-th Largest GroupTime Limit: 2000MS Memory Limit: 131072KDescriptionNewman likes playing with cats. He possesses lots of cats in his home. Because the number of cats i原创 2016-03-26 15:48:03 · 423 阅读 · 0 评论 -
Codeforces Round #343 (Div. 2) A B C D
链接:戳这里A. Far Relative’s Birthday Caketime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDoor's family is going celebrate Famil Doors's原创 2016-03-20 22:05:25 · 666 阅读 · 0 评论 -
BestCoder Round #65 B C D || HDU 5591 5592 5593
B 题意:ZYB在远足中,和同学们玩了一个“数字炸弹”游戏:由主持人心里想一个在[1,N][1,N]中的数字XX,然后玩家们轮流猜一个数字,如果一个玩家恰好猜中XX则算负,否则主持人将告诉全场的人当前的数和XX比是偏大还是偏小,然后猜测的范围就会相应减小,一开始的范围是[1,N][1,N].每个玩家只能在合法的范围中猜测. 现在假设只有两个人在玩这个游戏,并且两个人都已经知道了最后的XX,若两个人原创 2016-03-16 21:10:43 · 358 阅读 · 0 评论 -
蓝桥杯 MST 和 搜索
链接:戳这里 历届试题 兰顿蚂蚁 时间限制:1.0s 内存限制:256.0MB 问题描述 兰顿蚂蚁,是于1986年,由克里斯·兰顿提出来的,属于细胞自动机的一种。 平面上的正方形格子被填上黑色或白色。在其中一格正方形内有一只“蚂蚁”。 蚂蚁的头部朝向为:上下左右其中一方。 蚂蚁的移动规则十分简单:原创 2016-03-16 22:22:30 · 419 阅读 · 0 评论 -
懒散线段树
链接:http://codevs.cn/problem/1082/1082 线段树练习 3 时间限制: 3 s 空间限制: 128000 KB 题目等级 : 大师 Master题解题目描述 Description给你N个数,有两种操原创 2015-03-18 21:12:25 · 352 阅读 · 0 评论 -
vijos 1514 RMQ
链接:https://vijos.org/p/1514描述从前有个人名叫W and N and B,他有着天才般的记忆力,他珍藏了许多许多的宝藏。在他离世之后留给后人一个难题(专门考验记忆力的啊!),如果谁能轻松回答出这个问题,便可以继承他的宝藏。题目是这样的:给你一大串数字(编号为1到N,大小可不一定哦!),在你看过一遍之后,它便消失在你面前,随后问题就出现了,给你M个询原创 2015-04-12 23:09:30 · 493 阅读 · 0 评论 -
poj 3468 A Simple Problem with Integers LAZY线段树
链接:戳这里A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KCase Time Limit: 2000MSDescriptionYou have N integers, A1, A2, ... , AN. You need to deal with two kinds o原创 2016-04-14 22:00:51 · 277 阅读 · 0 评论 -
Codeforces Round #348 (VK Cup 2016 Round 2, Div. 1 Edition) C 离散化+树状数组+map D 数学
链接:戳这里C. Little Artem and Random Variabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Artyom decided to study probab原创 2016-04-28 21:41:25 · 446 阅读 · 0 评论 -
Codeforces Round #271 (Div. 2) E 离散化+线段树
链接:戳这里E. Pillarstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMarmot found a row with n pillars. The i-th pillar has the heig原创 2016-07-31 14:43:07 · 411 阅读 · 0 评论 -
Codeforces Round #271 (Div. 2) F 线段树+pair
链接:戳这里F. Ant colonytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMole is hungry again. He found one ant colony, consisting of原创 2016-07-29 22:18:24 · 568 阅读 · 0 评论 -
2016 Multi-University Training Contest 1 1004 hdu 5726 二分+RMQ
链接:戳这里GCDTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionGive you a sequence of N(N≤100,000) integers : a1,...,an(0 Inp原创 2016-07-19 17:24:55 · 651 阅读 · 0 评论 -
Codeforces Round #275 (Div. 2) D 线段树
链接:戳这里D. Interesting Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe'll call an array of n non-negative integers a[1],原创 2016-07-29 12:19:55 · 620 阅读 · 0 评论 -
Codeforces Round #361 (Div. 2) D RMQ+二分
链接:戳这里D. Friends and Subsequencestime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMike and !Mike are old childhood rivals, they原创 2016-07-07 21:29:25 · 440 阅读 · 0 评论