自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

qqspeed

希望CCNU的ACM越来越好,再见!

  • 博客(11)
  • 问答 (1)
  • 收藏
  • 关注

原创 hdu 4451 Dressing

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4451 注意只有“clothes x pants y” or “pants y shoes z”  这两种表达 #include #include #include using namespace std; int n,m,k,p,x,y,a[1010],b[1010]; char s[10

2012-10-31 16:55:35 677

原创 hdu 4438 Hunters

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4438 比较选tiger和wolf的期望值,取大者。 比如选tiger. 则期望=x*(1-q)//BOB选的wolf            +q*(p*x+p*y)//bob也选的tiger,所以再射杀tiger后,俩人再去争wolf #include int main()

2012-10-28 22:04:13 1256 1

原创 hdu 1686 Oulipo

#include #include #include using namespace std; int n,p[10010],l1,l2; char s1[10010],s2[1000100]; void getp() { int i,j=-1; p[0]=-1; for(i=1;i<l1;i++) { while(j>=0&&s1[i]!=s1[j

2012-10-24 16:16:49 628

转载 kmp的next数组值的求法

转载于:http://blog.csdn.net/guo_love_peng/article/details/6618170        int get_nextval(SString T,int &nextval[ ]){            //求模式串T的next函数修正值并存入数组nextval。            i=1; nextval[1]=0; j=0

2012-10-24 15:13:15 803

原创 HDU 1195 OPEN THE LOCK

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1195 bfs,和每次有三种可能。 #include #include #include #include using namespace std; struct node { int x[4],time; }; int T,vis[10][10][10][10]; ch

2012-10-15 15:23:25 539

原创 hdu 2612 Find a way

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2612 刚开始是每一个@Bfs一次,结果超时,因为有很多地方出现了重复计算,所以就一次BFS把所有能到的地方的时间求出来,然后求最小值。 #include #include #include #include using namespace std; struct node { int x,

2012-10-14 21:49:08 557

原创 hdu 1240 Asteroids!

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1240 BFS水题,注意x,y,z的顺序。 #include #include #include #include using namespace std; struct node { int x,y,z,time; }; char s[10]; char map[15][15][1

2012-10-06 20:17:05 667

原创 hdu 1181 变形课

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1181 DFS水题,注意输出不要忘了句号。 #include #include #include using namespace std; struct { char x,y; }a[10000]; int vis[10000],flag,k,l; char s[10000]

2012-10-04 20:43:10 2193

原创 hdu 1242 &&zoj 1649 Rescue

hdu链接:http://acm.hdu.edu.cn/showproblem.php?pid=1242 zoj链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=649 现在hdu上看到这道题,直接BFS,没想到HDU的数据太弱,居然BFS过了,但在zoj上就不停地wa. 后来看别人的解题报告,才知道原

2012-10-03 19:40:46 966

原创 hdu 1253 胜利大逃亡

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1253 BFS  水题。 A是z轴 #include #include #include #include using namespace std; int k,a,b,c,t,vis[60][60][60],map[60][60][60]; int dx[]={1,-1,0,0,0,0}

2012-10-03 17:29:38 778

原创 hdu 1372 Knight Moves

题目链接  :http://acm.hdu.edu.cn/showproblem.php?pid=1372 BFS   水题。 原来骑士走的是“日”格 #include #include #include #include using namespace std; int dx[]={-2,-2,-1,-1,1,1,2,2}; int dy[]={1,-1,2,-2,2,-2

2012-10-01 14:45:01 535

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除