上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 59 下一页
摘要: 1004 Counting Leaves (30分) A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. In 阅读全文
posted @ 2019-12-25 10:29 知道了呀~ 阅读(537) 评论(0) 推荐(0) 编辑
摘要: 1003 Emergency (25分) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities 阅读全文
posted @ 2019-12-23 21:18 知道了呀~ 阅读(891) 评论(0) 推荐(1) 编辑
摘要: 一级标题 二级标题 阅读全文
posted @ 2019-12-20 11:04 知道了呀~ 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 1、先序序列确定根节点 2、后序序列区分左右子树 #include<iostream> #include<algorithm> #include<vector> #include<math.h> #include<stdio.h> #include<string.h> #include<map> # 阅读全文
posted @ 2019-11-28 16:38 知道了呀~ 阅读(1379) 评论(0) 推荐(0) 编辑
摘要: 代码: #include<iostream> #include<algorithm> #include<vector> #include<math.h> #include<stdio.h> #include<string.h> #include<map> #include<queue> #inclu 阅读全文
posted @ 2019-11-28 16:32 知道了呀~ 阅读(4491) 评论(0) 推荐(0) 编辑
摘要: 已知前序遍历序列和中序遍历序列,可以唯一确定一棵二叉树。 已知后序遍历序列和中序遍历序列,可以唯一确定一棵二叉树。 但是已知前序遍历序列和后序遍历序列,是不能确定一棵二叉树的。 下面例子通过前序遍历和中序遍历确定唯一的一棵二叉树。 前序遍历:EACBDGF 中序遍历:ABCDEFG 1、首先根据前序 阅读全文
posted @ 2019-11-28 16:02 知道了呀~ 阅读(6508) 评论(0) 推荐(1) 编辑
摘要: F: Horse Pro 豆豆也已经开始学着玩象棋了,现在豆豆已经搞清楚马的走法了,但是豆豆不能确定能否在 100 步以内从一个点到达另一个点(假设棋盘无限大)。 Input 第一行输入两个整数 x1,y1 表示当前马所在的位置。 第二行输入两个整数 x2,y2 表示豆豆想把马走在的位置。 −100 阅读全文
posted @ 2019-11-25 21:53 知道了呀~ 阅读(403) 评论(0) 推荐(0) 编辑
摘要: B: 最小代价 题解:先用最小生成树求联通所有点的最小代价ans 在求度为1的时候权值最大的点mx ans-mx就是答案 #include<iostream> #include<algorithm> #include<vector> #include<math.h> #define ll long 阅读全文
posted @ 2019-11-25 16:05 知道了呀~ 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/1168/C来源:牛客网 题目描述 已知了飞行器的起点和终点以及n个休息站的坐标,问起点到终点的最短路径是多少? 限制:飞行器不能长期飞行,必须中途在某结点下停下休息。(即连续飞行距离应不大于m) 欧涛师兄很想在师妹面前大 阅读全文
posted @ 2019-11-24 21:03 知道了呀~ 阅读(408) 评论(0) 推荐(0) 编辑
摘要: B: Prime Split 题解: 1、先判断两个素数w[i]、w[j]的和是否大于n-2,若小于则说明数字n不可能由三个素数组成(2是最小的素数) 2、再判断n-w[i]-w[j]是否是素数 3、保证w[i]、w[j]、n-w[i]-w[j]是递增的,避免重复计数 //注意laz[]要和线段树数 阅读全文
posted @ 2019-11-24 20:46 知道了呀~ 阅读(637) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 59 下一页