上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 46 下一页
摘要: 博客 : http://blog.csdn.net/liuchuo/article/details/52296646 fill函数的作用是:将一个区间的元素都赋予val值。函数参数:fill(vec.begin(), vec.end(), val); val为将要替换的值。 fill 与 memse 阅读全文
posted @ 2017-11-24 08:18 楼主好菜啊 阅读(727) 评论(0) 推荐(0)
摘要: 先补充几种常见的位运算 1.判断一个数字x二进制下第i位是不是等于1。 方法:if ( ( ( 1 << ( i - 1 ) ) & x ) > 0) 将1左移i-1位,相当于制造了一个只有第i位上是1,其他位上都是0的二进制数。然后与x做与运算,如果结果>0,说明x第i位上是1,反之则是0。 2. 阅读全文
posted @ 2017-11-23 09:19 楼主好菜啊 阅读(154) 评论(0) 推荐(0)
摘要: 超大背包问题:有n个重量和价值分别为w[i]和v[i]的物品,从这些物品中挑选总重量不超过W的物品,求所有挑选方案中价值总和的最大值。其中,1 ≤ n ≤ 40, 1 ≤ w[i], v[i] ≤ 10^15, 1 ≤ W ≤ 10^15. 按照普通的DP 思路显然是无法求解的, 背包的体积太大了, 阅读全文
posted @ 2017-11-19 21:03 楼主好菜啊 阅读(590) 评论(0) 推荐(0)
摘要: 推荐博客 : https://www.cnblogs.com/cobbliu/archive/2012/05/21/2512249.html C++ 封装好的二分查找 https://www.cnblogs.com/cobbliu/archive/2012/05/21/2512249.html 阅读全文
posted @ 2017-11-19 10:49 楼主好菜啊 阅读(141) 评论(0) 推荐(0)
摘要: Simon is doing a physics experiment with N identical balls with the same radius of R centimeters. Before the experiment, all N balls are fastened with 阅读全文
posted @ 2017-11-18 23:10 楼主好菜啊 阅读(229) 评论(0) 推荐(0)
摘要: 推荐博客 : http://blog.csdn.net/yew1eb/article/details/38728357 阅读全文
posted @ 2017-11-17 12:02 楼主好菜啊 阅读(153) 评论(0) 推荐(0)
摘要: Demy has n jewels. Each of her jewels has some value vi and weight wi. Since her husband John got broke after recent financial crises, Demy has decide 阅读全文
posted @ 2017-11-17 12:01 楼主好菜啊 阅读(300) 评论(0) 推荐(0)
摘要: 转 http://lib.csdn.net/article/cplusplus/46023 C++中floor,ceil , round , rint用法转载 2016年09月19日 00:16:361.Math.floorfloor,英文原意:地板。 Math.floor 函数是求一个浮点数的地板 阅读全文
posted @ 2017-11-17 09:28 楼主好菜啊 阅读(234) 评论(0) 推荐(0)
摘要: The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians 阅读全文
posted @ 2017-11-14 20:57 楼主好菜啊 阅读(201) 评论(0) 推荐(0)
摘要: 有些题目让你求一个区间的素数 基于普通的埃氏筛法, 衍生出区间筛法,例如求 [ a, b ]内的素数,可以先将 [ 0, 根号b ]内的素数全都找出来,然后在将 [ a, b ]内是其 [ 0, 根号b ] 中素数的倍数的数全部划去,区间剩余的数即为素数。 阅读全文
posted @ 2017-11-14 20:53 楼主好菜啊 阅读(226) 评论(0) 推荐(0)
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 46 下一页