摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3711分析:直接暴力 1 #include <cstdio> 2 #include <cstring> 3 4 const int MAXN = 100 + 10; 5 6 struct Set 7 { 8 int num; 9 char bi[25];10 };11 12 char str[25];13 int m, n;14 char temp[25];15 Set S[MAXN];16 17 void Change( int num )18 {19 memset( .. 阅读全文
posted @ 2012-08-05 15:08 冰鸮 阅读(189) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3714这题我死活没读懂什么意思,后来还是别人讲的我才明白。题目:给出一组一元二次方程,用这一组一元二次方程生成一个新的函数F(x),求F(x)的最小值。x 对应F(x) 的值=这一组一元二次方程中yi = ai * x^2 + bi * x + ciy最大的那一个。分析:凹函数求极值,三分法。 1 #include <cstdio> 2 #include <cstring> 3 4 struct node 5 { 6 int a, b, c; 7 }; 8 9 const i 阅读全文
posted @ 2012-08-05 15:05 冰鸮 阅读(234) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3713题目:两个小球同时在两个迷宫里走,求使两个小球同时到达终点的最短走法。小球不能越出迷宫界,也不能掉到洞里。有的格子有挡板,如果挡板阻碍了小球的移动,则小球会呆在原地不动。如果有多组解,输出字典序最小的那个。分析:裸BFS,但是我错了很多遍,因为之前有些地方没想清楚。1,一开始我把 [小球被挡板阻碍] 和 [小球越界,小球掉到洞里] 放到一起考虑,写了个判断,都认为它们是不可达的。这是错误的。实际上这是两种情况,因为题目中有说:The barriers may make the commands 阅读全文
posted @ 2012-08-05 14:53 冰鸮 阅读(416) 评论(0) 推荐(0)