StonesProblem DescriptionBecause of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back ev...
分类:
其他好文 时间:
2015-07-28 20:57:34
阅读次数:
101
Problem Description
Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some...
分类:
其他好文 时间:
2015-07-28 18:47:22
阅读次数:
112
在通过后缀名查找类型文件的时候, 多次使用endwith, 使用元组(tuple), 简化操作.
此类方式, 也可以应用于if语句多次相似检测.代码# 列出文件夹内所有代码
def list_dictionary_codes(root_dir):
paths_list = []
for parent, dirNames, fileNames in os.walk(root_dir)...
分类:
编程语言 时间:
2015-07-26 09:50:06
阅读次数:
181
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3822本场比赛之前,我记得。见WALK概率路DP称号。那么它应该是可以考虑的概率DP,十一还特意看了碍着,当场景。真的OUT了。然后好激动的样子,開始推得二维。然后感觉好难推。...
分类:
其他好文 时间:
2015-07-25 19:51:45
阅读次数:
139
这道题是神坑啊,花了我将近3个小时,本来敲的挺顺的,交上去就是wa,坑点真坑,原来是有的路口交叉点可以没有
路通向它,无语,没有路通向也可以叫交叉点。。。。以后一定得考虑多种情况,用了bfs(vector做的)和dfs判断
的是否连通,判断连通之后只需要再判断是否都有偶数个度就ok了,坑,真坑。
bfs代码:
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2015-07-24 10:45:58
阅读次数:
110
题意:gbn最近打算穿过一个森林,但是他比较傲娇,于是他决定只走一些特殊的道路,他打算只沿着满足如下条件的(A,B)道路走:存在一条从B出发回家的路,比所有从A出发回家的路径都短。你的任务是计算一共有多少条不同的回家路径。其中起点的编号为1,终点的编号为2.
思路:首先从终点Dijkstra一次,求出每个点u回家的最短路长度,那么相当于创建了一个新图,当d[B]
#include
#inc...
分类:
其他好文 时间:
2015-07-23 00:39:24
阅读次数:
112
Trail WalkTime Limit: 2 Seconds Memory Limit: 65536 KBFatMouse is busy organizing the coming trail walk. After the route for the trail walk has bee...
分类:
其他好文 时间:
2015-07-22 18:06:52
阅读次数:
129
//给一个无向图 , n个节点,m条边
//每个节点为起点的概率相同
//问每个节点走d步后不经过这个节点的概率
//不经过这个节点的概率等于去掉该节点的图中走了d步到其他节点的和
//dp[i][j] 为走了i步到达j个节点的概率
//dp[i][j] = segma(dp[i-1][v])/vec[j].size()
#include
#include
#include
#...
分类:
其他好文 时间:
2015-07-22 16:16:47
阅读次数:
88
原帖:http://stackoverflow.com/questions/1722137/scala-2-8-collections-design-tutorial There's a2.8 collection walk-throughby Martin Odersky which should...
分类:
其他好文 时间:
2015-07-19 11:30:26
阅读次数:
102
题目传送门 1 /* 2 题意:问一个点到另一个点的最少转向次数。 3 坐标离散化+BFS:因为数据很大,先对坐标离散化后,三维(有方向的)BFS 4 关键理解坐标离散化,BFS部分可参考HDOJ_1728 5 */ 6 #include 7 #inc...
分类:
其他好文 时间:
2015-07-18 15:21:10
阅读次数:
111