csu 1604 SunnyPig (bfs)】的更多相关文章

Description SunnyPig is a pig who is much cleverer than any other pigs in the pigpen. One sunny morning, SunnyPig wants to go out of the pigpen to date Mrs. Snail, his beloved. However, it’s terribly tough for a pig to go out of the pigpen because th…
1356: Catch Time Limit: 2 Sec  Memory Limit: 128 MBSubmit: 96  Solved: 40[Submit][Status][Web Board] Description A thief is running away!We can consider the city where he locates as an undirected graph in which nodes stand for crosses and edges stand…
传送门: http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2031 Description The Barareh village is on fire due to the attack of the virtual enemy. Several places are already on fire and the fire is spreading fast to other places. Khorzookhan who is the…
传送门: http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1726 1726: 你经历过绝望吗?两次! Submit Page    Summary    Time Limit: 1 Sec     Memory Limit: 128 Mb     Submitted: 859     Solved: 290 Description 4月16日,日本熊本地区强震后,受灾严重的阿苏市一养猪场倒塌,幸运的是,猪圈里很多头猪依然坚强存活.当地15名…
题目大意: 不想介绍,题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1259 bfs求最短路. 这里因为2-9,到达同样的点不计步数,那我们不能每次bfs都遍历一个图找到所有相同的点,所以这里用vector[10],保存对应的2-9的相同的节点 题目本身比较简单,只是考虑的东西有点多,慢慢写就行了 #include <cstdio> #include <cstring> #include <iostream>…
1106: 最优对称路径 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 371  Solved: 77[Submit][Status][Web Board] Description 给 一个n行n列的网格,每个格子里有一个1到9的数字.你需要从左上角走到右下角,其中每一步只能往上.下.左.右四个方向之一走到相邻格子,不能斜着走, 也不能走出网格,但可以重复经过一个格子.为了美观,你经过的路径还必须关于“左下-右上”这条对角线对称.下图是一个6x6网…
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1566 题意还是蛮难懂的,至少对于我来说,需要认真读题. 输入矩阵的每一个数字换成2进制后,顺时针围一圈,用1表示墙,0表示空,这样就可以表示出一个迷宫,现在就是判断这个迷宫属于4种类型中哪种类型. 参考了 大神博客.构图很难,并且想法跟以往的题都不一样.是一个好题. #include <iostream> #include <cstdio> #include <cmath&g…
题意: 3*3方格,有一个是空的.其他的每个格子里有一个立方体.立方体最初上下白色,前后红色,左右蓝色.移动的方式为滚.给出初态空的位置,终态上面颜色情况,问最少多少步能到达.如果超过30步不能到达,-1. 思路: 模拟. 另外再加了一个A*优化.就是估计一下.应该还能优化的.感觉像二进制上可以优化.实在不想写了. 代码: //16:50 #include <cstdio> #include <cstring> #include <queue> #include <…
可以吃饭啦!!! A:连通块 ZOJ 1709 Oil Deposits(dfs,连通块个数) B:素数变换 打表+bfs POJ 3216 Prime Path(打表+bfs) C:水bfs HDU 2717 Catch That Cow(常规bfs) D:bfs+状态压缩 HDU 1429 胜利大逃亡(续)(bfs+状态压缩,很经典) E:bfs+优先队列 CSU 1726: 你经历过绝望吗?两次!(bfs+优先队列) F:bfs+优先队列(还有点问题) G:很有意思的bfs CodeFor…
传送门: http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1224 1224: ACM小组的古怪象棋 Lime Limit: 1 Sec     Memory Limit: 128 Mb     Submitted: 918     Solved: 382 Description ACM小组的Samsara和Staginner对中国象棋特别感兴趣,尤其对马(可能是因为这个棋子的走法比较多吧)的使用进行深入研究.今天他们又在 构思一个古怪的棋局…