随笔分类 - 算法_线段树
摘要:#include #include #include using namespace std; typedef long long ll; const int MAXN = 100009; int n, q; ll sum[MAXN * 4], add[MAXN * 4]; void build(int l, int r, int rt) { add[rt] = 0; if...
阅读全文
摘要:1798: [Ahoi2009]Seq 维护序列seq Description 老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成。 有长为N的数列,不妨设为a1,a2,…,aN 。有如下三种操作形式: (1)把数列中的一段数全部乘一个值; (2)把数列中的一段数全部加一个值; (3)询问
阅读全文
摘要:皮卡丘的梦想2 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 一天,一只住在 501 实验室的皮卡丘决定发奋学习,成为像 LeiQ 一样的巨巨,于是他向镇上的贤者金桔请教如何才能进化成一只雷
阅读全文
摘要:覆盖的面积 Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5595 Accepted Submission(s): 2810 Problem
阅读全文
摘要:Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12266 Accepted Submission(s): 5151 Probl
阅读全文
摘要:Description Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counti
阅读全文
摘要:Can you answer these queries? Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 15314 Accepted Subm
阅读全文
摘要:Mayor's posters Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 62771 Accepted: 18120 Description The citizens of Bytetown, AB, could not s
阅读全文
摘要:Tunnel Warfare Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8115 Accepted Submission(s): 3142
阅读全文
摘要:LCIS Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7193 Accepted Submission(s): 3069 Problem De
阅读全文
摘要:Posters Problem Description Ted has a new house with a huge window. In this big summer, Ted decides to decorate the window with some posters to preven
阅读全文
摘要:Billboard Problem Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width
阅读全文
摘要:Picture Problem Description A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are al
阅读全文
摘要:Luck and Love Problem Description 世界上上最远的距离不是相隔天涯海角而是我在你面前可你却不知道我爱你 ―― 张小娴前段日子,枫冰叶子给Wiskey做了个征婚启事,聘礼达到500万哦,天哪,可是天文数字了啊,不知多少MM蜂拥而至,顿时万人空巷,连扫地的大妈都来凑热闹来
阅读全文
摘要:Just a Hook Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up
阅读全文
摘要:It’s normal to feel worried and tense the day before a programming contest. To relax, you went out fora drink with some friends in a nearby pub. To ke
阅读全文
摘要:敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 78691 Accepted Submission(s): 33255 Problem
阅读全文
摘要:A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 97196 Accepted: 30348 Case Time Limit: 2000MS Description Y
阅读全文