http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4842要注意题目中两点:1.在踏入妖怪控制的区域那一刹那,先减行动力,然后才能杀妖怪2.在妖怪控制区域行动力也会恢复3.妖怪也许不在自己的控制区域#include #include...
分类:
其他好文 时间:
2015-05-17 18:27:16
阅读次数:
137
You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose the ith door, it can either ta...
分类:
其他好文 时间:
2015-05-17 16:49:18
阅读次数:
118
Children of the Candy Corn
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 10739
Accepted: 4626
Description
The cornfield maze is a popular Halloween treat. ...
分类:
其他好文 时间:
2015-05-16 14:58:36
阅读次数:
139
题意:有n*m矩阵,'.'为空地,'#'为墙。在空地上添加k堵墙使得最后空地联通。保证有解。
思路:随便送任何一个空地走,走到不能走为止,那么这个位置就可以设为'X'。然后回溯将路径上的空地都设为'x'。很明显最后的图是联通的。
#include
using namespace std;
int n,m,k;
char ch[501][501];
int vis[501][501];
...
分类:
其他好文 时间:
2015-05-14 18:41:44
阅读次数:
126
Description Usually the path in a maze is calculated as the sum of steps taken from the starting point until the ending point, assuming that the dista...
分类:
其他好文 时间:
2015-05-11 01:15:00
阅读次数:
234
本文是Taste for Makers的中文翻译, 经原作者Paul Graham的同意,公开发表. 在保留和不改变本版权信息的前提下, 本译文可以自由地复制,变更和再发布.Copyright 2002 by Paul Graham原文: http://www.paulgraham.com/tast...
分类:
其他好文 时间:
2015-05-10 11:10:31
阅读次数:
137
http://acm.hdu.edu.cn/showproblem.php?pid=4035求步数期望,设E[i]为在编号为i的节点时还需要走的步数,father为dfs树中该节点的父节点,son为dfs树种该节点的子节点的集合,kl[i]为被杀掉的概率,ex[i]为逃出的概率mv[i]=(1-kl...
分类:
其他好文 时间:
2015-05-07 14:11:20
阅读次数:
95
题意:n*m大的迷宫 ,有p种钥匙。钥匙最多有10种,所以可以用状压表示门需要钥匙的状态, 还有已经拥有哪几把钥匙的状态。
然后下来一个k,然后k行表示 (x1,y1),(x2,y2)直接有门或者墙。 如果g==0 ,就是有墙, 如果g>0 表示有门,且门需要第g把钥匙才能开。
然后下来一个s,然后s行,表示(x,y)这个点有 第g把钥匙。
问从(1,1)到(n,m)最少几步。
做法:状压, 每个点有四个方向,记录能否通过的状态, 门的话 标记为-1, 0,表示不用钥匙,>0 的话,哪位上是1,...
分类:
其他好文 时间:
2015-05-05 23:59:50
阅读次数:
360
Description
The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wielding psychopaths, hippies, and other terro...
分类:
其他好文 时间:
2015-05-02 15:14:04
阅读次数:
131
11624 Fire!
Joe works in a maze. Unfortunately, portions of the maze have caught onfire,and the owner of the maze neglected to create a firee scape plan.Help Joe escape the maze.
Given ...
分类:
其他好文 时间:
2015-04-28 22:59:05
阅读次数:
179