题意:
给定n个点m条边的无向图
问:
从任意点出发任意走d步,从不经过某个点的概率
dp[i][j]表示从不经过i点的前提下,走了d步到达j点的概率。
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define N 55
#define...
分类:
其他好文 时间:
2014-09-13 18:49:45
阅读次数:
145
//中序遍历int inorder_tree_walk(BinTreeNode * root){ if(root == NULL){ return -1; } stack s; BinTreeNode * p = root; while(!s.empty(...
分类:
其他好文 时间:
2014-09-05 14:15:11
阅读次数:
142
前序遍历二叉树int preorder_tree_walk(BinTreeNode * root){ if(root == NULL){ return -1; } stack s; BinTreeNode * p = root; while(!s.empt...
分类:
其他好文 时间:
2014-09-05 14:10:51
阅读次数:
170
UVA 10917 - Walk Through the Forest
题目链接
题意:公司编号为1,家编号为2,每次回家都不走回头路,回头路定义为:满足条件的道路(A,B),满足存在一条从B出发比所有从A出发的回家的路径都短,问有几种走法
思路:先从家求dijstra,这样满足条件的道路就是d[A] > d[B],这个图是一个dag,在上面进行dp就可以找出种数了
代码:...
分类:
Web程序 时间:
2014-09-02 15:51:55
阅读次数:
256
小三 mistress / the other woman破坏别人家庭的人 home wrecker耍心机 to scheme跑龙套 、群众演员 extra / walk-on大腕 big shot替身 stunt-double
分类:
其他好文 时间:
2014-09-02 10:11:34
阅读次数:
183
To follow the path: look to the master,(寻找大师) follow the master,(跟随大师) walk with the master,(与大师同行) see through the master,(观摩大师) become the master.(成...
分类:
其他好文 时间:
2014-08-26 00:06:05
阅读次数:
231
脚本:#!/usr/bin/envpython
#encodingutf-8
importos
importtypes
Driver="d:"
#输出D盘下的所有文件
foriinos.walk(Driver+os.sep+"python-study"):
print(type(i))
print(i) 输出结果<class‘tuple‘>(‘d:\\python-study‘,[],[‘1.txt‘,‘a.py‘,‘a1.py‘,‘a2.py‘,‘a3-fo..
分类:
其他好文 时间:
2014-08-22 02:56:55
阅读次数:
220
Problem You receive a credit C at a local store and would like to buy two items. You first walk through the store and create a list L of all available items. From this list you would like to buy tw...
分类:
其他好文 时间:
2014-08-18 12:42:04
阅读次数:
222
Description
Optimal Symmetric Paths
You have a grid of n rows and
n columns. Each of the unit squares contains a non-zero digit. You walk from the top-left square to the b...
分类:
其他好文 时间:
2014-08-16 12:36:50
阅读次数:
332
A Walk Through the Forest
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5688 Accepted Submission(s): 2089
Problem Description...
分类:
其他好文 时间:
2014-08-14 10:49:48
阅读次数:
255