
技巧和优化
文章平均质量分 80
guognib
这个作者很懒,什么都没留下…
展开
-
二进制 快速count 1
转载:http://www.cnblogs.com/grenet/archive/2011/06/10/2077228.html http://www.cppblog.com/zenliang/articles/131761.htm 原题:一个正整数,转成二进制后,这个二进制数包含多少个1? 这个问题在网上看过多次,几番思考,也没有什么好的办法。采用最基本的办法,逐转载 2013-10-30 16:32:19 · 811 阅读 · 0 评论 -
ZOJ 3768 Continuous Login(暴力或夹逼原理)
参考: http://blog.youkuaiyun.com/zhuhuangjian/article/details/23036139 http://blog.youkuaiyun.com/mid_kkks/article/details/23034401 本题预处理之后,就是一个背包问题,但是容量10e9,不能用背包。最后是判断出最多选择3个数,暴力解决或利用夹逼原理。 夹逼原理:2个数时,利用夹原创 2014-04-06 20:42:06 · 1407 阅读 · 0 评论 -
三分模板
using namespace std; typedef long long LL; const int INF = 0x3f3f3f3f; const int maxn = 100010; const int MOD = 1000000007; int n, m; int a[1000100]; LL calc(int idx) { LL ans = 0; int x = -1原创 2014-05-03 22:20:39 · 2425 阅读 · 0 评论