
离线处理
coldfresh
那我们开始吧
展开
-
Mishka and Interesting sum CodeForces - 703D(离线处理)
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integers a1, a2, …, an of n elements!Mishka loved the array and she i原创 2017-07-02 14:21:21 · 421 阅读 · 0 评论 -
How far away ? HDU - 2586 (LCA)
There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How far is it if I want to go from house A to house B”? Usually it hard to原创 2017-07-26 19:00:39 · 287 阅读 · 0 评论 -
小Z的袜子(hose) HYSBZ - 2038(莫队算法)
作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的袜子会很尴尬。 你的任务便是告诉小Z,他有多大的概率抽到两只颜色相同原创 2017-08-14 12:59:27 · 399 阅读 · 0 评论 -
Travel HDU - 5441 (带权并查集+离线)
Jack likes to travel around the world, but he doesn’t like to wait. Now, he is traveling in the Undirected Kingdom. There are nn cities and mm bidirectional roads connecting the cities. Jack hates wait原创 2017-09-22 14:28:47 · 368 阅读 · 0 评论 -
Sum Of Gcd HDU - 4676(莫队)
Given you a sequence of number a 1, a 2, …, a n, which is a permutation of 1…n. You need to answer some queries, each with the following format: Give you two numbers L, R, you should calculate sum原创 2017-10-20 16:07:59 · 355 阅读 · 0 评论 -
Query on A Tree HDU - 6191 (离线+01字典树合并)
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. ...原创 2018-07-17 18:41:37 · 262 阅读 · 0 评论 -
Different Integers(Nowcoder多校训练第一场J题)(树状数组+离线)
Given a sequence of integers a 1 , a 2 , …, a n and q pairs of integers (l 1 , r 1 ), (l 2 , r 2 ), …, (l q , r q ), find count(l 1 , r 1 ), count(l 2 , r 2 ), …, count(l q , r q ) where count(i, j) ...原创 2018-07-19 20:33:54 · 501 阅读 · 0 评论