高斯消元 求期望题意:数轴上有0~n-1 个点,你每次可能走k步,1#include #include #include #include #include #define eps 1e-8#define INF 1e9using namespace std;double P[500] ;int v...
分类:
其他好文 时间:
2015-08-04 20:56:26
阅读次数:
102
Bus PassTime Limit: 5 Seconds Memory Limit: 32768 KBYou travel a lot by bus and the costs of all the seperate tickets are starting to add up.Theref...
分类:
其他好文 时间:
2015-08-03 20:36:58
阅读次数:
127
1900. Brainwashing Device
Time limit: 1.0 second
Memory limit: 64 MB
While some people travel in space from planet to planet and discover new worlds, the others who live on Earth still have...
分类:
其他好文 时间:
2015-08-03 19:11:55
阅读次数:
369
题目:
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from statio...
分类:
编程语言 时间:
2015-08-01 22:01:59
阅读次数:
188
题目大意:有N个点,M条边,每次删掉一条边,问删掉该边后,所有点之间的最短路的和是多少解题思路:刚开始就想,删掉一次floyd一次,结果可想而之,TLE了
后来看了别人的,发现了一种叫做最短路树的东西。
就是先求出以每个点为源点的最短路并纪录该点到每个点的距离和,和每个点的pre,这样的话,就预处理好了
因为要删掉边,前面我们已经预处理好了最短路树的pre,也就是说,就可以依次判断删除的边是否...
分类:
其他好文 时间:
2015-08-01 01:08:13
阅读次数:
93
后序遍历的遍历中,某一个节点要被输出,在两种情况下:当前节点的左右孩子为空;当前节点的左右孩子已经被访问。第一种情况非常容易判断第二种情况需要记录访问过的节点,显然当前节点如果有孩子,则对它的访问会紧跟在它的孩子节点之后,无论是左右。所以只需记录每次访问的节点,就Ok![1]http://www.c...
分类:
其他好文 时间:
2015-07-25 12:06:37
阅读次数:
96
题意:给n个城市m条路的网图,pp在城市1有一定的钱,想游览这n个城市(包括1),到达一个城市要一定的花费,可以在城市工作赚钱,但前提有工作证(得到有一定的花费),没工作证不能在该城市工作,但可以走,一个城市只能工作一次,问pp是否能游览n个城市回到城市1.分析:这个题想到杀怪(Survival(Z...
分类:
其他好文 时间:
2015-07-24 23:57:56
阅读次数:
174
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its nex...
分类:
其他好文 时间:
2015-07-22 21:01:26
阅读次数:
217
题意:给你一些N个点,M条边,走每条边要花费金钱,然后给出其中必须访问的点,在这些点可以打工,但是需要先拿到证书,只可以打一次,也可以选择不打工之直接经过它。一个人从1号点出发,给出初始金钱,问你能不能访问所以的点,并且获得所以证书。题解:目标是那些一定要访问的点,怎么到达的我们不关心,但是我们关系...
分类:
其他好文 时间:
2015-07-21 22:09:52
阅读次数:
144
DownloadsPE ViewerPE Maker - Step 1- Add new Section.PE Maker - Step 2- Travel towards OEP.PE Maker - Step 3- Support Import Table.PE Maker - Step 4- ...
分类:
其他好文 时间:
2015-07-21 20:33:10
阅读次数:
1260