上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 45 下一页
摘要: 3461. 在哈尔滨的寒风中 Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit pe 阅读全文
posted @ 2017-12-09 15:13 楼主好菜啊 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 所谓的数据离线处理,就是将所有的输入数据全部读入后,在进行统一的操作,这样当然有好处,比如让你算好多数的阶层,但是输入的每个数是没有顺序的,其实跟可以线性的解决,但是由于没有顺序的输入,这样处理的话复杂度就很高,若将输入的这些数据全部先存起来,再排序,然后按从小到大的顺序处理。 f(n)=(∏i=1 阅读全文
posted @ 2017-11-25 09:40 楼主好菜啊 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 博客 : 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 楼主好菜啊 阅读(669) 评论(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 楼主好菜啊 阅读(131) 评论(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 楼主好菜啊 阅读(553) 评论(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 楼主好菜啊 阅读(129) 评论(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 楼主好菜啊 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 推荐博客 : http://blog.csdn.net/yew1eb/article/details/38728357 阅读全文
posted @ 2017-11-17 12:02 楼主好菜啊 阅读(140) 评论(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 楼主好菜啊 阅读(275) 评论(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 楼主好菜啊 阅读(193) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 45 下一页