摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4287题意:给出n个手机数字序列,m个英文组合,求每个数字序列对应的可能的英文组合在下边的出现了多少个。思路:才开始想复杂了,其实只要用一个map即可。View Code #include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <queue>#include <stack>#includ 阅读全文
posted @ 2012-09-11 23:47 E_star 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 天津赛区网络赛的两道题目1:http://acm.hdu.edu.cn/showproblem.php?pid=4282题意:给你一个K (0 < K < 2^31) ,求正整数X,Y,Z满足X^Z + Y^Z + XYZ = K,有多少组。(X < Y, Z > 1)思路:如果暴力枚举的话,肯定会超时。这里关键是31.因为1<=X < Y 所以Y>=2所以Z<31;对于X他最大肯定小于5000(因为50000^2 > 2^31)所以我们只要枚举x和z然后在区间[x + 1,5000]二分查找即可O(50000*31*log(50000)) 阅读全文
posted @ 2012-09-11 23:40 E_star 阅读(273) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4284题解:http://www.cnblogs.com/E-star/archive/2012/09/11/2680992.htmlView Code #include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <queue>#include <stack>#include <set 阅读全文
posted @ 2012-09-11 23:19 E_star 阅读(183) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4282题解:http://www.cnblogs.com/E-star/archive/2012/09/11/2680992.htmlView Code #include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <queue>#include <stack>#include <set 阅读全文
posted @ 2012-09-11 23:15 E_star 阅读(334) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4280题意:给定平面上n个点的坐标,最左边的点为源点,最右边的点为汇点,给出m条边的容量求最大流。思路:才开始理解错了题意,For safety, no two routes are cross or overlap and no routes will pass an island except the departing island and the arriving island。以为要处理线段不能相交什么的,不知道怎么做了。原来直接见图套模板即可,题目保证不会相交。为此我和von纠结了好久。。View 阅读全文
posted @ 2012-09-11 23:10 E_star 阅读(542) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4279题意:给出a,b两个数,1<=a<=b 如果a,b不互质,且a%b != 0则说明a是b的特殊数字f[i]表示i拥有的特殊数字的个数,如果f[i]是奇数,那么i就是real numbers给出区间[x,y]求区间内的real numbers的数量。思路:打标找规律,真心不好发现这规律;大于12之后 d[x] = x/2 -1或者d[x] = x/2 - 2;(d[x]表示1到x拥有的real numbers的数量)发现在遇到平方数是转变原来-1变为-2,否则-2变为-1。 p^2 <= 阅读全文
posted @ 2012-09-11 23:03 E_star 阅读(187) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4278题意:一个特殊的汽车行程计数器,当每个位出现3或者8时直接跳到下一位;0 1 2 4 5 6 7 910 11 12 14 15 16 17 1920 21 22 24 25 26 27 29......思路:YY发现其实可以映射到8进制数,(0 - 9)表示10进制数,将(0 1 2 4 5 6 7 9 )映射到(0 - 8)其实就是8进制的表示。View Code #include <iostream>#include <cstdio>#include <cstring 阅读全文
posted @ 2012-09-11 22:51 E_star 阅读(199) 评论(0) 推荐(0) 编辑