XTUOJ 15503 - C】的更多相关文章

15503 - C Accepted: 6    Submissions: 27    Time Limit: 3000 ms    Memory Limit: 1048576 KB 在解决了小女孩的谜题后,小女孩很大方的告诉了deemo她的名字:Alice.从此deemo不再孤单一人了.他们每天快乐的生活在一起.deemo平时喜欢弹钢琴,Alice会静静的坐在他的身边,看deemo以前看过的书. “deemo,你的书里的谜题都好难啊.”Alice歪着脑袋愁眉苦脸的看着书.“想知道答案可以问我,…
这个题一眼看上去不会 然后有人说是网络流 然后我就想怎么建图啊,然后不会(是本蒟蒻太垃圾了),肯定有网络流解法 然后去群里问了gdut的巨巨,他说他队友爆搜+剪枝过了(我也是非常的叹服) 然后我也写了一个2^50的搜索剪枝,居然真过了(不知道是数据弱还是大力出奇迹) #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #…
题意:挺好懂得 分析:先计算出如果不能用(减2)操作,至少需要多少个(减3)操作,这个很好计算 然后就是尽量多的去减少(减3)操作,肯定先抹平 余2 和 余1 的,然后就可以了 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #include <queue> #i…
题目链接:http://202.197.224.59/OnlineJudge2/index.php/Problem/read/id/1252 思路:考虑每条边对玩家的伤害 假设连接的节点是u,v,破坏力是p[u]和p[v] 假设p[u]>p[v] 现在考虑u,v的删除顺序,如果先删u,这条边对玩家的伤害,是p[v],先删v,伤害是p[u] 所以显然对于每条边,我们都要先删权值大的,才能最好 怎么样才能对于每条边先删最大的呢,那就按照权值递减删就好了 所以 ret=Σ(min(p[u],p[v])…
题意:一颗树,定义一条路径的权值等于路径的边权之和,需要求这颗树所有路径中权值的最大值 思路: 考虑到路径权值与点权的最值有关,而最值的问题通常可以通过排序就行处理,于是想到先把点权排序. 容易看出如果某条路径的权值是通过某个点算出的最小 ,那么肯定这条路径肯定不会经过权值更小的点,于是有了两种处理思路 1.按点权从小到大删点,对于即将删除的点,比他权值小的点已经被删去了,所以只要在当前状态的森林里找一条最长路径乘以次点权就可以更新答案 2.按点权从大到小加点,显然新加进来的点权值最小,当前树里…
Coins Accepted : 120   Submit : 305 Time Limit : 1000 MS   Memory Limit : 65536 KB Coins Problem Description: Duoxida buys a bottle of MaiDong from a vending machine and the machine give her n coins back. She places them in a line randomly showing he…
CQRXLB Accepted : 19   Submit : 40 Time Limit : 1000 MS   Memory Limit : 65536 KB CQRXLB Problem Description: CQR and XLB are best friends. One night, they are staring each other and feel boring, and XLB says let's play game! They place n piles of st…
 I Love Military Chess Accepted : 45   Submit : 141 Time Limit : 1000 MS   Memory Limit : 65536 KB 题目描写叙述 陆军棋,又称陆战棋,简称军棋.是中国近代的一种两人棋类,设计依据军队中的军阶. 每一方有25枚棋子.先夺得对方军旗者为胜. 棋子 每一方的棋子为25枚.包含: 军阶高低 棋子名称 各方枚数 特殊能力 1 司令 1 无 2 军长 1 无 3 师长 2 无 4 旅长 2 无 5 团长 2…
Segment Tree Accepted : 3 Submit : 21Time Limit : 9000 MS Memory Limit : 65536 KB Problem Description: A contest is not integrity without problems about data structure. There is an array a[1],a[2],…,a[n]. And q questions of the following 4 types:1 l…
Range Time Limit : 1000 MS Memory Limit : 65536 KB Problem Description For an array, the range function is defined below: Range(A)=Max(A)-Min(A)+1; For example, suppose A={1,2,3,4,5}, then Range(A)=5-1+1=5. Now, given an array A(length≤100000), you a…