2018年3月29日

摘要: 用emwin做界面的时候遇到的错误,MDK5可能无法编译一些汉字编码,对应汉字在信息反馈中会显示为乱码,更会附带一些如“expected a "}"”这样的错误提示。 解决方法:Options for Target “你的工程名”(MDK5的魔术棒) -> C/C++ -> Misc Control 阅读全文
posted @ 2018-03-29 11:36 LegendaryAC 阅读(1546) 评论(1) 推荐(0) 编辑

2015年12月30日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5512gcd(a,b)的位置都是可以选的,之后判断一下奇偶#include #include using namespace std;int gcd(int a, int b) { return a == 0... 阅读全文
posted @ 2015-12-30 10:02 LegendaryAC 阅读(270) 评论(0) 推荐(1) 编辑

2015年12月21日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1863复习考研练练写Prim,第一次写,乱搞的,有点难看邻接表+堆#include #include #include #include using namespace std;int n, m, cnt, ct,... 阅读全文
posted @ 2015-12-21 18:49 LegendaryAC 阅读(172) 评论(0) 推荐(0) 编辑

2015年11月28日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1710题意:给二叉树的先序遍历和中序遍历,确定后序遍历解法:复习专业课找的一题,根据先序遍历和中序遍历建树,再对树做后序遍历#include #include using namespace std;struct ... 阅读全文
posted @ 2015-11-28 22:34 LegendaryAC 阅读(239) 评论(0) 推荐(0) 编辑

2015年9月19日

摘要: 输入n,把1-n分成两个和相等的子集,有多少种分法想了个dp,直接背包也行#include #include using namespace std;int dp[55];int main() { int n; scanf("%d", &n); int s = n * (n + 1... 阅读全文
posted @ 2015-09-19 11:08 LegendaryAC 阅读(185) 评论(0) 推荐(0) 编辑

2015年7月22日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5289给一个数列,求有多少区间,使得这些区间内的最大值减最小值小于k单调队列的功能:O(1) 插入,删除,最大or最小方法:枚举区间的后界,找前界(一定可以找到一个后界使得这个后界的前面所有满足要求,后面所有不满足... 阅读全文
posted @ 2015-07-22 13:39 LegendaryAC 阅读(714) 评论(0) 推荐(0) 编辑

2015年6月19日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1237表达式计算,方法是中缀转后缀,再计算。中间处理用栈操作讲解看http://blog.csdn.net/antineutrino/article/details/6763722这题是简易版本的,不用处理括号#i... 阅读全文
posted @ 2015-06-19 21:31 LegendaryAC 阅读(249) 评论(0) 推荐(0) 编辑

2015年6月18日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4771给一个地图,@是起点,给一些物品坐标,问取完所有物品的最小步数,不能取完输出-1物品数最多只有四个,状态压缩一下bfs即可#include #include #include #include #inclu... 阅读全文
posted @ 2015-06-18 23:31 LegendaryAC 阅读(292) 评论(0) 推荐(0) 编辑
 
摘要: http://poj.org/problem?id=297601分数规划问题,可以舍掉k组01分数规划用于解决的经典问题是最优比率生成树解法见http://www.cnblogs.com/lotus3x/archive/2009/03/21/1418480.html#include #includ... 阅读全文
posted @ 2015-06-18 19:34 LegendaryAC 阅读(198) 评论(0) 推荐(0) 编辑

2015年6月16日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1839题意:从1到n,要求时间小于等于T到达。每条边有一个容量,问最多能运多少货物。分析:最多能运的货物取决于路径上边的最小容量,所以二分容量,再用最短路判断时限即可。最短路里面多加一个判断保证走的边都能满足当前容... 阅读全文
posted @ 2015-06-16 17:12 LegendaryAC 阅读(237) 评论(0) 推荐(0) 编辑