![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
文章平均质量分 81
bool_isprime
这个作者很懒,什么都没留下…
展开
-
hdu2141Can you find it?
<br /> Can you find it?<br />Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others)<br />Total Submission(s): 2006 Accepted Submission(s): 456<br /><br />Problem DescriptionGive you three sequences of numbers A, B, C, then原创 2010-08-07 23:04:00 · 458 阅读 · 0 评论 -
hdu1175连连看
<br />#include<iostream><br />#include<queue><br />using namespace std;<br />#define size 1005<br />int n,m,sum,start;<br />int map[size][size],turn[size][size];<br />int dir[4][2]={{0,-1},{0,1},{-1,0},{1,0}};<br />int sx,sy,ex,ey;<br />struct Node<br />{<原创 2010-08-11 09:43:00 · 650 阅读 · 0 评论 -
hdu1240 Asteroids!
搜索题也做了几天了,慢慢找到点感觉了。这题没多大变化,就是变成三维的咯。#include#includeusing namespace std;#define size 15int n;char map[size][size][size];bool visit[size][size][size];int sx, sy, sz;int ex, ey, ez;int dir[6][3]={{0,0,-1},{0,0,1},{0,-1,0},{0,1,0},{-1,0,0},{1,0,0}};struct Nod原创 2010-08-10 16:28:00 · 425 阅读 · 0 评论 -
hdu2514 Another Eight Puzzle
<br />#include<iostream><br />#include<cmath><br />using namespace std;<br />int x[10],f[10][10],a[10],num,i;<br />int used(int n)<br />{<br /> for(i=1;i<n;i++)<br /> if(x[i]==x[n])return 1;<br /> return 0;<br />}<br />void fun()<br />{<br />原创 2010-08-10 16:51:00 · 720 阅读 · 0 评论 -
hdu 2717&&pku3278 Catch That Cow
题意:农夫找丢失的牛,x->x-1,x->x+1,x->2*x三种走法,牛不动,求最短的时间找到牛,用bfs。#include#includeusing namespace std;#define size 100005int tag[size];void bfs(int n,int k){ if(n==k) { cout return; } int i; queueque; memset(tag,0,sizeof(tag)); que原创 2010-08-11 23:04:00 · 620 阅读 · 0 评论 -
hdu1026Ignatius and the Princess I
<br /> <br />这题用的也是bfs,就是保存路径这里麻烦。。<br />#include<iostream><br />#include<queue><br />using namespace std;<br />#define max 99999999<br />int dir[4][2]={{0,-1},{0,1},{-1,0},{1,0}};<br />int flag;<br />int sum,n,m;<br />char map[105][105];<br />struct Node<原创 2010-08-12 21:32:00 · 393 阅读 · 0 评论 -
hdu1372Knight Moves
<br />很简单的一道广搜题,最近广搜还是做了有几道咯。这是上个专题回家落下的一道题,今天A了一下,还是蛮简单的。对深搜还是不太懂。这道题的代码可以当做很好的广搜模板。(七夕,晚上跑来基地一群光棍在喊寂寞。哈哈,很搞笑哦)<br /><code><br />#include<iostream><br />#include<queue><br />using namespace std;<br />#define size 10<br />int flag[size][size];<br />char st原创 2010-08-16 19:00:00 · 625 阅读 · 0 评论 -
pku1011
<br />题意:自己看,麻烦翻译了,这道题是很经典的搜索题,用深搜。。<br />SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 72164 Accepted: 15847<br />DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he原创 2010-08-13 17:42:00 · 395 阅读 · 0 评论