摘要: 不大明白啥叫记忆化搜索,但是PC学长说就相当于打表~不大懂= =。。。回头好好看一下题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1501参考着崔老师的代码来的。View Code 1 #include<stdio.h> 2 #include<string.h> 3 4 char s1[205],s2[205],s3[410]; 5 int len,count,vis[205][205],leap; 6 void dfs(int a,int b,int c) 7 { 8 if(leap) 9 return;10 if(v.. 阅读全文
posted @ 2012-08-01 22:18 某某。 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1372大体意思是给你一个8*8的棋盘,然后给你两个字母与数字的组合,字母代表的是行,数字代表咧,让你找出从第一个组合的位置到第二个组合的位置,至少要走多少步。View Code 1 #include<stdio.h> 2 #include<string.h> 3 struct node 4 { 5 int x,y,step; 6 }q[100005]; 7 int map[15][15]; 8 int pro[15][15]; 9 int to[8][2] = {{2,1}, 阅读全文
posted @ 2012-08-01 20:38 某某。 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1253三维的BFS,跟地下城那道题很像。不用怎么解释。题目上说的很清楚。View Code 1 #include <stdio.h> 2 #include <string.h> 3 struct node 4 { 5 int x,y,z; 6 int t; 7 }q[1000005]; 8 int map[55][55][55]; 9 int pro[55][55][55],f,r;10 int to[6][3] = {{0,0,1},{0,0,-1},{0,1,0},{0,- 阅读全文
posted @ 2012-08-01 20:27 某某。 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1241题目大意是@是可以走的,让你找出是不是有几块是连载一起的。跟挑战编程上的一道题木很想、View Code 1 #include <stdio.h> 2 #include <string.h> 3 4 char map[110][110]; 5 int vis[110][110]; 6 int to[8][2] = {{0,1},{0,-1},{1,0},{1,1},{1,-1},{-1,0},{-1,1},{-1,-1}}; 7 int n,m,count; 8 9 vo 阅读全文
posted @ 2012-08-01 20:25 某某。 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1015题目的大意就是给以一串字符串和一个目标数字,让你从中找出5个字母,依次可以满足v - w^2 + x^3 - y^4 + z^5 = target这个关系式如果有多个就按字典序最大的输出。。。View Code #include <stdio.h>#include <string.h>#include <stdlib.h>int vis[100005];char str[100005];int sum,leap;char end[10],temp[10];in 阅读全文
posted @ 2012-08-01 20:21 某某。 阅读(247) 评论(0) 推荐(0) 编辑