共15页: 首页 上一页 5 6 7 8 9 10 11 12 13 下一页 末页 
摘要: 树状数组是一种常用的数据结构,能够在O(log2n)的时间内进行单点修改和求前缀和。因为代码量小、常熟小往往在某些应用中快于线段树(当然有些问题是不能呢用树状数组完成的)。 最基本的树状数组 方法1:用一个数组,O(1)修改, O(n)查询 方法2:求前缀和,O(n)修改,O(1)查询 以上两种方法阅读全文
posted @ 2017-07-20 12:11 阿波罗2003 阅读(48) 评论(0) 编辑
摘要: Input Output Sample Input Sample Output Hint N<=100000 M<=200000 K<=100000 题目大意 给出一个有n个节点和m条边的图,然后有k个询问,每个询问是删掉一些边,然后判断图是否连通,询问之间互相独立。 连通性问题通常的做法是并查集,阅读全文
posted @ 2017-07-18 16:46 阿波罗2003 阅读(100) 评论(0) 编辑
摘要: 永无乡包含 n 座岛,编号从 1 到 n,每座岛都有自己的独一无二的重要度,按照重要度可 以将这 n 座岛排名,名次用 1 到 n 来表示。某些岛之间由巨大的桥连接,通过桥可以从一个岛 到达另一个岛。如果从岛 a 出发经过若干座(含 0 座)桥可以到达岛 b,则称岛 a 和岛 b 是连 通的。现在有阅读全文
posted @ 2017-07-18 11:54 阿波罗2003 阅读(68) 评论(0) 编辑
摘要: Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks that a positive integer number 阅读全文
posted @ 2017-07-17 15:43 阿波罗2003 阅读(72) 评论(0) 编辑
摘要: 题目传送门 传送门I 传送门II 传送门III 题目大意 求一个满足$d\sum_{i = 1}^{n} \left \lceil \frac{a_i}{d} \right \rceil - \sum_{i = 1}^{n} a_{i} \leqslant K$的最大正整数$d$。 题目传送门 传送阅读全文
posted @ 2017-07-17 10:35 阿波罗2003 阅读(120) 评论(0) 编辑
摘要: ( 转载请注明原帖地址http://www.cnblogs.com/yyf0309/p/LeftistTree.html ,转载不注明地址必究 ) 左偏树是可并堆的一种实现。对比一下普通的堆和左偏树 插入 取出顶部元素 弹出 合并 普通的堆 $O(\log n)$ $O(1)$ $O(\log n)阅读全文
posted @ 2017-07-17 07:59 阿波罗2003 阅读(1276) 评论(1) 编辑
摘要: Byteotian Interstellar Union (BIU) has recently discovered a new planet in a nearby galaxy. The planet is unsuitable for colonisation due to strange m阅读全文
posted @ 2017-07-16 16:33 阿波罗2003 阅读(48) 评论(0) 编辑
摘要: There are n people and k keys on a straight line. Every person wants to get to the office which is located on the line as well. To do that, he needs t阅读全文
posted @ 2017-07-16 12:44 阿波罗2003 阅读(74) 评论(0) 编辑
摘要: Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that: No two balls share the same l阅读全文
posted @ 2017-07-15 22:52 阿波罗2003 阅读(85) 评论(0) 编辑
摘要: Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is po阅读全文
posted @ 2017-07-14 16:32 阿波罗2003 阅读(247) 评论(0) 编辑
摘要: Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points w阅读全文
posted @ 2017-07-14 16:10 阿波罗2003 阅读(46) 评论(0) 编辑
摘要: Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is constant; after that it is strictly decreasing. The fi阅读全文
posted @ 2017-07-14 16:02 阿波罗2003 阅读(55) 评论(0) 编辑
摘要: Everyone knows that DNA strands consist of nucleotides. There are four types of nucleotides: "A", "T", "G", "C". A DNA strand is a sequence of nucleot阅读全文
posted @ 2017-07-13 09:30 阿波罗2003 阅读(145) 评论(0) 编辑
摘要: Arkady needs your help again! This time he decided to build his own high-speed Internet exchange point. It should consist of n nodes connected with mi阅读全文
posted @ 2017-07-12 17:17 阿波罗2003 阅读(111) 评论(0) 编辑
摘要: Ivan had string s consisting of small English letters. However, his friend Julia decided to make fun of him and hid the string s. Ivan preferred makin阅读全文
posted @ 2017-07-12 17:10 阿波罗2003 阅读(71) 评论(0) 编辑
摘要: Pronlem A In a small restaurant there are a tables for one person and b tables for two persons. Pronlem A In a small restaurant there are a tables for阅读全文
posted @ 2017-07-12 16:56 阿波罗2003 阅读(28) 评论(0) 编辑
摘要: 我先用费用流的方法去跑spfa,然后完美T掉6个点。 就说正解吧,正解是跑两次spfa,然后就可以找出最短路覆盖的边(详细过程请看代码rebuild())。然后建图跑最大流 Code 二分答案,然后奇、偶数分开分别连源点和汇点,两者加起来是素数就加一条边。特殊处理1,只保留一个。 Code 先Tar阅读全文
posted @ 2017-07-12 11:12 阿波罗2003 阅读(37) 评论(0) 编辑
摘要: John is the only priest in his town. September 1st is the John's busiest day in a year because there is an old legend in the town that the couple who 阅读全文
posted @ 2017-07-11 12:05 阿波罗2003 阅读(35) 评论(0) 编辑
摘要: liympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tired of such easy阅读全文
posted @ 2017-07-11 09:49 阿波罗2003 阅读(24) 评论(0) 编辑
摘要: 自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果阅读全文
posted @ 2017-07-10 12:06 阿波罗2003 阅读(23) 评论(0) 编辑
摘要: Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about阅读全文
posted @ 2017-07-10 12:00 阿波罗2003 阅读(50) 评论(0) 编辑
摘要: ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" like阅读全文
posted @ 2017-07-10 11:57 阿波罗2003 阅读(25) 评论(0) 编辑
摘要: It's well known that the best way to distract from something is to do one's favourite thing. Job is such a thing for Leha. So the hacker began to work阅读全文
posted @ 2017-07-10 11:51 阿波罗2003 阅读(228) 评论(0) 编辑
摘要: You have n devices that you want to use simultaneously. The i-th device uses ai units of power per second. This usage is continuous. That is, in λ sec阅读全文
posted @ 2017-07-09 23:09 阿波罗2003 阅读(88) 评论(0) 编辑
摘要: Description 有N个工作,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成。 现在给出这些参数,求最大利润 Input 第一行给出 N,M(1<=N<=1200,1<=M<=1200) 下面将有N块数据,每块数据第一阅读全文
posted @ 2017-07-08 11:10 阿波罗2003 阅读(37) 评论(0) 编辑
共15页: 首页 上一页 5 6 7 8 9 10 11 12 13 下一页 末页