最短路水题,这次用SPFA写#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std...
分类:
其他好文 时间:
2014-07-18 21:02:55
阅读次数:
207
In a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoceros Party has decided on the following strategy. Every ...
分类:
其他好文 时间:
2014-07-18 20:15:42
阅读次数:
234
A - Accurately Say "CocaCola"!DescriptionIn a party held by CocaCola company, several students stand in a circle and play a game.One of them...
分类:
其他好文 时间:
2014-07-18 00:01:04
阅读次数:
239
The Dole Queue
In a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoceros Party has decided on the following strategy. Every day all dole applicants...
分类:
其他好文 时间:
2014-07-16 08:38:31
阅读次数:
311
题目大意:
说七个party选择数字(各不相同)
而规定的小象的party选择的数字之中所拥有的数字4和7的个数要比其他六个party拥有的个数之和还要严格多,询问方案数。
如m=7时其余的随意选择至少会拥有一个4或7,与题意矛盾,故方案数为0
m=8时,7 1 2 3 5 6 8是一种合法方案
思路:
由于小象的party选到的数字所含4和7的个数至多和m的位数一样多,则枚举小象的party所含4和7的个数,剩余的6个party直接用dfs即可(直接用乘法原理)。
而通过数位dp可以算出1~m之中所拥有...
分类:
其他好文 时间:
2014-07-10 19:44:26
阅读次数:
193
一、编译boost库第一步:下载boost库,下载地址http://sourceforge.net/projects/boost/files/boost/1.55.0/第二部:解压boost库,例如解压到F:\Third-party libs\boost\boost_1_55_0第三部:开始->程序...
分类:
其他好文 时间:
2014-07-09 23:06:43
阅读次数:
332
题目来源:Light OJ 1316 1316 - A Wedding Party
题意:和HDU 4284 差不多 有一些商店 从起点到终点在走过尽量多商店的情况下求最短路
思路:首先预处理每两点之前的最短路 然后只考虑那些商店 个数小于15嘛 就是TSP问题 状态压缩DP搞一下 状态压缩姿势不对 有必要加强
#include
#include
#include
#include...
分类:
其他好文 时间:
2014-07-08 19:37:07
阅读次数:
241
Cake
Time Limit: 1 Second
Memory Limit: 32768 KB
You want to hold a party. Here's a polygon-shaped cake on the table. You'd like to cut the cake into several triangle-shaped parts for th...
分类:
其他好文 时间:
2014-07-08 15:36:15
阅读次数:
298
在ueditor.mini for asp.net 中,将上传的图片保存的路径更改了,可图片在 world 编辑器中不显示,但却可以上传到指定的保存目录下,解决这个问题的方法 是: 在udditor_mini--->third-party---->umeditor.config.js中, 也就是 u...
分类:
其他好文 时间:
2014-07-06 15:58:42
阅读次数:
230
求来回最短路加起来最长的一条。
两次SPFA,然后选某个点的来回最长。(有向图)
Dijkstra+邻接矩阵 比较方便建立 反向图。
我用SPFA+2个邻接表(正图+反图),C++ 32ms。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
...
分类:
其他好文 时间:
2014-07-03 16:01:33
阅读次数:
173