数据结构构构构
OneDay_pyf
这个作者很懒,什么都没留下…
展开
-
ECNU-3263
丽娃河的狼人传说 Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: 256 megabytes丽娃河是华师大著名的风景线。但由于学校财政紧缺,丽娃河边的路灯年久失修,一到晚上就会出现走在河边要打着手电的情况,不仅非常不方便,而且影响安全:已经发生了大大小小的事故多起。 方便起见,丽原创 2017-05-14 14:51:52 · 368 阅读 · 0 评论 -
bzoj1969LANE 航线规划
对Samuel星球的探险已经取得了非常巨大的成就,于是科学家们将目光投向了Samuel星球所在的星系——一个巨大的由千百万星球构成的Samuel星系。 星际空间站的Samuel II巨型计算机经过长期探测,已经锁定了Samuel星系中许多星球的空间坐标,并对这些星球从1开始编号1、2、3……。 一些先遣飞船已经出发,在星球之间开辟探险航线。 探险航线是双向的,例如从1号星球到3号星球开辟探险航线,那原创 2017-09-13 01:59:35 · 500 阅读 · 0 评论 -
hdu6200mustedge mustedge mustedge
Give an connected undirected graph with n nodes and m edges, (n,m≤105) which has no selfloops or multiple edges initially. Now we have q operations (q≤105):⋅1 u v: add an undirected edge from u to v;原创 2017-09-13 20:02:40 · 683 阅读 · 0 评论 -
HDU - 6191 Query on A Tree 可持久化Tire
Monkey A lives on a tree, he always plays on this tree. One day, monkey A learned about one of the bit-operations, xor. He was keen of this interesting operation and wanted to practise it at once. Monk原创 2017-09-05 14:17:51 · 583 阅读 · 0 评论 -
hdu6162 Ch’s gift
Problem Description Mr. Cui is working off-campus and he misses his girl friend very much. After a whole night tossing and turning, he decides to get to his girl friend’s city and of course, with well原创 2017-08-23 00:40:55 · 395 阅读 · 0 评论 -
树的重心
今天想起来学树上点分治,其实我还是不明白为啥,大概就学了一手树的重心吧2333 定义是去掉重心之后能使剩下的每个子树尽量平衡。那么先处理出每个点子树的size,然后枚举去掉每个点后最大子树最小的就是重心。最大子树包括两部分,由于dfs求size的时候是自己设定根为1的,而求重心判断的时候是以当前点为根的,所以除了正常的这个点的子树外,他的父亲所在的也作为他的一课子树模版题 poj 1655让你求原创 2017-07-23 21:36:33 · 402 阅读 · 0 评论 -
主席树入门
主席树原创 2017-07-23 20:20:58 · 443 阅读 · 0 评论 -
shu_mj 的数据结构专场(二)
Problem A: 求个和 (shuoj1883)Description 给你一个长为N 的序列,M 条询问,每次问你[l, r] 区间内,所有数字的和是多少。Input 第一行包含两个整数 N, M。 第二行有 N 个整数 Ai,表示这个序列。 接下来 M 行,每行两个整数 l r,表示一个询问。0 < N, M < 1e5 -1e4 < Ai < 1e4 0 < l <= r <原创 2017-04-25 01:14:17 · 372 阅读 · 0 评论 -
Minimum Inversion Number HDU - 1394
The inversion number of a given number sequence a1, a2, …, an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a given sequence of numbers a1, a2, …, an, if we move the first m >= 0原创 2017-05-09 02:32:49 · 410 阅读 · 0 评论 -
Codeforces799C. Fountains
Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coi原创 2017-05-14 15:28:44 · 542 阅读 · 2 评论 -
Weak Pair HDU - 5877
You are given a rootedrooted tree of NN nodes, labeled from 1 to NN. To the iith node a non-negative value aiai is assigned.An orderedordered pair of nodes (u,v)(u,v) is said to be weakweak if (1)原创 2017-05-14 15:16:50 · 637 阅读 · 0 评论 -
2014 icpc 西安现场赛 I - International Collegiate Routing Contest
-0-马上上计网了,感觉没什么空再看笛卡尔树了2333来水篇博客 还一个多礼拜就要去西安当分母了。第一次当分母内心还有点小紧张2333 然后我们来看看这个强行银牌题。。 队友还是强啊,五分钟把铜牌题公式甩我脸上了然鹅QWQ 这个银牌题其实也不是很难(如果看得懂题的话) 首先把所有ip换成二进制表示,题目表示如果有效前缀相同那么他们在一个子网内。 那么怎么才算有效前缀呢。看/后面那个数字,原创 2017-10-17 13:55:11 · 825 阅读 · 1 评论