上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 30 下一页
摘要: 题目链接:http://poj.org/problem?id=1958 代码: #include<iostream> #include<cstring> using namespace std; #define maxn 100 typedef long long ll; ll d[maxn],f[ 阅读全文
posted @ 2020-06-14 11:53 WA自动机~ 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 给定n个点的带权路径,求0到n-1的最短哈密顿通路,使用位运算以及动态规划的思想进行精确计算,实际上算法能处理的结点数量大约在20个,如果只需要获得 比较优的解可以通过神经网络、模拟退火等最优化理论的算法进行搜索。 代码如下: #include<iostream> #include<string.h 阅读全文
posted @ 2020-06-13 23:16 WA自动机~ 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1710 通过先序以及中序遍历建树并且输出后序遍历的结果。 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int u 阅读全文
posted @ 2020-06-13 21:43 WA自动机~ 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1527 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; 阅读全文
posted @ 2020-06-06 18:02 WA自动机~ 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1848 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; 阅读全文
posted @ 2020-06-06 17:54 WA自动机~ 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1846 代码: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; ty 阅读全文
posted @ 2020-06-06 15:58 WA自动机~ 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2067 #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; typede 阅读全文
posted @ 2020-06-06 14:06 WA自动机~ 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1521 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; 阅读全文
posted @ 2020-06-06 11:26 WA自动机~ 阅读(200) 评论(0) 推荐(0) 编辑
摘要: dp: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; typedef unsigned long long ull; #define pf printf #def 阅读全文
posted @ 2020-06-06 09:45 WA自动机~ 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 以下代码中显示了二叉树的链式存储以及先序遍历递归建树,后序遍历释放资源,复制一棵二叉树,先序、中序、后序遍历的递归以及非递归实现,求叶子结点数量的递归以及非递归函数,求非叶子结点的递归以及非递归函数。求深度的递归函数。 文件输入,文件中的内容是 1 2 4 0 0 5 6 0 0 0 3 7 0 0 阅读全文
posted @ 2020-06-06 08:04 WA自动机~ 阅读(469) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 30 下一页