
离线算法
文章平均质量分 85
RJ28
小学生
展开
-
Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integersa1, a2, ..., an ofn elements!Mishka loved the array an原创 2016-08-05 23:00:52 · 306 阅读 · 0 评论 -
Hdu-5126 stars(cdq分治)
John loves to see the sky. A day has Q times. Each time John will find a new star in the sky, or he wants to know how many stars between(x1,y1,z1) and (x2,y2,z2). Input The first line co原创 2017-10-09 14:38:03 · 422 阅读 · 0 评论 -
Hdu-5869 Different GCD Subarray Query(区间不同值离线算法)
Problem DescriptionThis is a simple problem. The teacher gives Bob a list of problems about GCD (Greatest Common Divisor). After studying some of them, Bob thinks that GCD is so interesting. One day原创 2016-09-10 23:43:19 · 528 阅读 · 0 评论 -
Codeforces Round #182 (Div. 1) Yaroslav and Divisors(离线+树状数组)
Yaroslav has an array p = p1, p2, ..., pn (1 ≤ pi ≤ n), consisting of n distinct integers. Also, he has m queries:Query number i is represented as a pair of integers li, ri (1 ≤ li ≤ ri ≤ n).原创 2017-07-21 21:55:01 · 358 阅读 · 0 评论 -
Codeforces Round #395 (Div. 1) E. Timofey and our friends animals(lct动态维护mst)
After his birthday party, Timofey went to his favorite tree alley in a park. He wants to feed there his favorite birds — crows.It's widely known that each tree is occupied by a single crow family.原创 2017-02-03 17:48:53 · 490 阅读 · 0 评论 -
SPOJ-COT2 Count on a tree II(树上莫队)
You are given a tree with N nodes. The tree nodes are numbered from 1 to N. Each node has an integer weight.We will ask you to perform the following operation:u v : ask for how many different in原创 2017-01-26 16:30:29 · 511 阅读 · 0 评论 -
Bzoj-3289 Mato的文件管理(离线求区间逆序对数)
Mato同学从各路神犇以各种方式(你们懂的)收集了许多资料,这些资料一共有n份,每份有一个大小和一个编号。为了防止他人偷拷,这些资料都是加密过的,只能用Mato自己写的程序才能访问。Mato每天随机选一个区间[l,r],他今天就看编号在此区间内的这些资料。Mato有一个习惯,他总是从文件大小从小到大看资料。他先把要看的文件按编号顺序依次拷贝出来,再用他写的排序程序给文件大小排序。排序程序可以在1单原创 2017-01-25 23:23:02 · 432 阅读 · 0 评论 -
Hdu-5412 CRB and Queries(整体二分)
DescriptionThere are N boys in CodeLand. Boy i has his coding skill Ai. CRB wants to know who has the suitable coding skill. So you should treat the following two types of queries. Que原创 2016-10-07 21:54:16 · 352 阅读 · 0 评论 -
Codeforces Round #368 (Div. 2) D. Persistent Bookcase(离线)
D. Persistent Bookcase time limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputRecently in school Alina has learned what are原创 2016-08-21 12:16:59 · 434 阅读 · 0 评论 -
Hdu-6183 Color it(cdq分治)
Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program to ma原创 2017-10-31 17:59:36 · 327 阅读 · 0 评论