上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 30 下一页
摘要: 二叉树,若其与自己的镜像完全相同,就称其为镜像树。 是一棵镜像树;而 不是镜像树。现给你一棵二叉树,请你判断其是不是镜像树。         阅读全文
posted @ 2016-03-13 13:49 Vmetrio 阅读(311) 评论(0) 推荐(0)
摘要: 给出三个水杯,大小不一,并且只有最大的水杯的水是装满的,其余两个为空杯子。三个水杯之间相互倒水,并且水杯没有标识,只能根据给出的水杯体积来计算。现在要求你写出一个程序,使其输出使初始状态到达目标状态的最少次数。 Input 第一行一个整数N(0<N<50)表示N组测试数据接下来每组测试数据有两行,第 阅读全文
posted @ 2016-03-12 10:44 Vmetrio 阅读(370) 评论(0) 推荐(0)
摘要: 1 vector<int> p[MAX]; 2 int V; 3 int color[MAX]; 4 5 bool dfs(int v,int c) 6 { 7 color[v]=c; 8 for(int i=0; i<p[v].size(); i++){ 9 if(color[p[v][i]==c 阅读全文
posted @ 2016-03-10 20:15 Vmetrio 阅读(217) 评论(0) 推荐(0)
摘要:   阅读全文
posted @ 2016-03-08 20:08 Vmetrio 阅读(186) 评论(0) 推荐(0)
摘要: 自从2006年3月10日至11日的首届数独世界锦标赛以后,数独这项游戏越来越受到人们的喜爱和重视。据说,在2008北京奥运会上,会将数独列为一个单独的项目进行比赛,冠军将有可能获得的一份巨大的奖品———HDU免费七日游外加lcy亲笔签名以及同hdu acm team合影留念的机会。所以全球人民前仆后 阅读全文
posted @ 2016-03-08 17:50 Vmetrio 阅读(810) 评论(0) 推荐(0)
摘要: map的使用方法: 1 #include <cstdio> 2 #include <map> 3 #include <string> 4 using namespace std; 5 6 int main() 7 { 8 //声明int为键,const char* 为值 9 map<int,cons 阅读全文
posted @ 2016-03-06 16:30 Vmetrio 阅读(183) 评论(0) 推荐(0)
摘要: set是维护集合的容器 1 #include <cstdio> 2 #include <set> 3 using namespace std; 4 5 int main() 6 { 7 //声明 8 set<int> s; 9 10 //插入元素 11 s.insert(1); 12 s.inser 阅读全文
posted @ 2016-03-06 16:20 Vmetrio 阅读(135) 评论(0) 推荐(0)
摘要: 复杂度 O(logn) 1 #include <queue> 2 #include <cstdio> 3 using namespace std; 4 5 //表示节点的结构体 6 struct node{ 7 int val; 8 node *lch,*rch; 9 }; 10 11 //插入数值 阅读全文
posted @ 2016-03-06 16:04 Vmetrio 阅读(300) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2612 BFS搜索 目标地 并记录下来 之后再判断两段路程之和 代码: 1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 # 阅读全文
posted @ 2016-03-06 15:44 Vmetrio 阅读(275) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1584 全部状态都判断一遍 代码: 1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 #include <algorithm 阅读全文
posted @ 2016-03-06 14:48 Vmetrio 阅读(326) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 30 下一页