摘要:
题目链接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,- 阅读全文
摘要:
题目链接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 阅读全文
摘要:
题目链接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 阅读全文