随笔分类 - 线段树
摘要:Solutions A. Creating a Character 题意: 给出初始体力值$str$和智力值$int$,然后你可以把$exp$分别分配给这两个数值,使得分配后$str int$,求有多少种分配方案。 思路: 特判不可能情况:$str + exp int$,乱搞 正解: 假设分别分配给
阅读全文
摘要:Contest Info "Contest Link" Solved| A | B | C | D | E | F | G | H | I | J | K : : | : : | : :| : :| : : | : :| : :| : :| : : | : : | : : | : : 2/12 |O
阅读全文
摘要:Solutions A:Eddy Walker 题意: 给出$n$个点,编号为$0\sim n-1$,问走完所有点恰巧到达$m$点的概率。 思路: 如果,只要$m$不为$0$,到其他点概率都是一样的,为$\frac1{n-1}$,然后判$m=0$的情况。 B:Eddy Walker 2 题意: 某人
阅读全文
摘要:传送门 终于过了这道题。。 要注意标记之间的影响,和add操作时更新求和的顺序。 same 区间每个数设置为x标记 mult 区间每个数乘x标记 add 区间每个数加x标记 ①:当打same标记时,mult标记和add标记就没用了,要初始化。 ②:当打mult标记时,add标记也要乘相应的值。 求和
阅读全文
摘要:There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole compa
阅读全文
摘要:During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, vil
阅读全文
摘要:A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Ea
阅读全文
摘要:For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultim
阅读全文
摘要:Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counting the segme
阅读全文
摘要: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 of several consecutive metallic
阅读全文
摘要:You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number
阅读全文
摘要:很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,
阅读全文
摘要:C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生
阅读全文
摘要:Naive Operations Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 502768/502768 K (Java/Others)Total Submission(s): 3636 Accepted Submission(s): 1
阅读全文

浙公网安备 33010602011771号