- 博客(12)
- 收藏
- 关注
原创 poj 2676 Soduku dfs
题目:数独游戏 几个点:1、dfs;2、判断能不能用 挺简单的一个dfs,忘记恢复现场老跑不对。。。 #include #include #include using namespace std; struct node{ int h,w; int num; }; node st[100]; int map[9][9],cnt; bool IsOk(int h,i
2015-02-15 19:59:16
584
原创 poj 2251 逃出牢笼,简单的bfs
Dungeon Master Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18031 Accepted: 6994 Description You are trapped in a 3D dungeon and need to find the quicke
2015-02-12 22:22:26
658
原创 poj 3414 bfs 两个壶倒水,记录路径
题意:给你两个壶,容量分别为a,b,初始都是0,再给你一个目标水量c,问经过几次操作可以使得其中一个壶的水量为目标水量c,并且把操作步骤输出。 6个操作: 1、FILL(1)//FILL(i),把 i 壶装满 2、FILL(2) 3、DROP(1)//DROP(i),把 i 壶倒光 4、DROP(2) 5、POUR(1,2)//POUR(i,j)从 i 壶里倒水到 j 壶,直至 i 壶
2015-02-12 17:15:03
597
原创 poj 3009 dfs暴力解决最短路
题目就不粘了,题意是这样的:一个带网格的方格板,有两种方格,一种是白色的,一种是网状的。白色表示可以通过,用数字0表示,网状的表示障碍物不能通过,用数字1表示。起点和终点分别在两个白色的上面,分别用数字2、3表示。 目标就是从起点走到终点,且步数小于等于10。 走法和步数计算比较特殊:选定一个方向后,只要是通的就能走下去,三种情况:1、刚好走到终点;2、下一步是障碍物,没法走了,就停下来了,
2015-02-06 13:08:15
1457
原创 poj 3928 树状数组
/* Ping pong Time Limit: 1000MS Memory Limit: 65536K Description N(3<=N<=20000) ping pong players live along a west-east street(consider the street as a line segment). Each player has a unique skill
2014-12-20 15:00:28
684
原创 poj1577 二叉排序树基础练习题
Falling Leaves Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4011 Accepted: 2226 Description Figure 1 Figure 1 shows a graphical
2014-10-17 15:19:17
1237
原创 # 刷题记录——9.30
poj2109 poj2109 25号写的记录,补在这里。 2014.9.25 昨天写的,忘了记了。 k^n=p,给了p和n,求k。 数学上就是开根,这里数据范围很大,p最大10e101,只能用数组。 初步的想法是: ①确定k的数量级 ②二分逼近 比较麻烦的是在二分的过程中,需要写一个乘法的模拟过程,求mid的时候,也有模拟除法的过程。先这么写着,写完看有没有简
2014-10-05 23:26:54
646
原创 # 刷题记录——9.29
poj2079(贪心) poj1700(贪心) 1. poj2079 题意理解挺久的,在纠结needed colors是什么情况,后来看网上人说的才知道,是用来规定下限的……从题目方面感觉没什么意义啊,可能在运行上减少了点运算,出题者的善心? 恩。。。一开始以为needed colors是在配好gray之后还要剩下那么多ml,想说排个序,两端扫一遍,用最大的三个减
2014-10-05 23:26:09
629
原创 poj1979
Red and Black Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 22633 Accepted: 12217 Description There is a rectangular room, covered with
2014-09-13 21:38:43
751
原创 poj2386
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20476 Accepted: 10310 Description Due to recent rains, water has pooled in
2014-09-13 21:01:57
696
原创 poj2796
Feel Good Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 9748 Accepted: 2635 Case Time Limit: 1000MS Special Judge D
2014-09-07 16:35:48
809
原创 poj1363 入栈出栈模拟
Rails Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 25009 Accepted: 9804 Description There is a famous railway station in PopPush City.
2014-09-06 23:58:35
763
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人