11 2017 档案

摘要:所谓的数据离线处理,就是将所有的输入数据全部读入后,在进行统一的操作,这样当然有好处,比如让你算好多数的阶层,但是输入的每个数是没有顺序的,其实跟可以线性的解决,但是由于没有顺序的输入,这样处理的话复杂度就很高,若将输入的这些数据全部先存起来,再排序,然后按从小到大的顺序处理。 f(n)=(∏i=1 阅读全文
posted @ 2017-11-25 09:40 楼主好菜啊 阅读(166) 评论(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 楼主好菜啊 阅读(675) 评论(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 楼主好菜啊 阅读(132) 评论(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 楼主好菜啊 阅读(558) 评论(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 楼主好菜啊 阅读(131) 评论(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 楼主好菜啊 阅读(183) 评论(0) 推荐(0) 编辑
摘要:推荐博客 : http://blog.csdn.net/yew1eb/article/details/38728357 阅读全文
posted @ 2017-11-17 12:02 楼主好菜啊 阅读(141) 评论(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 楼主好菜啊 阅读(278) 评论(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 楼主好菜啊 阅读(197) 评论(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 楼主好菜啊 阅读(186) 评论(0) 推荐(0) 编辑
摘要:有些题目让你求一个区间的素数 基于普通的埃氏筛法, 衍生出区间筛法,例如求 [ a, b ]内的素数,可以先将 [ 0, 根号b ]内的素数全都找出来,然后在将 [ a, b ]内是其 [ 0, 根号b ] 中素数的倍数的数全部划去,区间剩余的数即为素数。 阅读全文
posted @ 2017-11-14 20:53 楼主好菜啊 阅读(203) 评论(0) 推荐(0) 编辑
摘要:推荐博客 :https://www.cnblogs.com/frog112111/archive/2012/08/19/2646012.html 欧几里得又称为辗转相除法,是用来求最大公约数的一种高效的算法。 核心就是一点 gcd(a, b) = gcd(b, a%b) ; 扩展欧几里得 两个不定方 阅读全文
posted @ 2017-11-14 09:39 楼主好菜啊 阅读(252) 评论(0) 推荐(0) 编辑
摘要:One day, Alice and Bob felt bored again, Bob knows Alice is a girl who loves math and is just learning something about matrix, so he decided to make a 阅读全文
posted @ 2017-11-13 22:27 楼主好菜啊 阅读(295) 评论(0) 推荐(0) 编辑
摘要:Read the program below carefully then answer the question. #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include<iostream 阅读全文
posted @ 2017-11-13 18:18 楼主好菜啊 阅读(275) 评论(0) 推荐(0) 编辑
摘要:Jzzhu has invented a kind of sequences, they meet the following property: You are given x and y, please calculate fn modulo 1000000007 (109 + 7). Inpu 阅读全文
posted @ 2017-11-11 20:32 楼主好菜啊 阅读(232) 评论(0) 推荐(0) 编辑
摘要:这里先引入一个快速幂 正常我们计算 x^22次方的话,要怎么去计算,暴力的话平方22次,这里想一个简单的方法,x^22要怎么计算出来, x^22 = x^16 * x^4 * x^2,折几个数怎么来的呢 ? 将22转换为 2进制的数 10110 ,正好不就是2^4 = 16, 2^2 = 4, 2^ 阅读全文
posted @ 2017-11-11 13:17 楼主好菜啊 阅读(190) 评论(0) 推荐(0) 编辑
摘要:1 . 数论的基本定理 阅读全文
posted @ 2017-11-10 21:50 楼主好菜啊 阅读(252) 评论(0) 推荐(0) 编辑
摘要:const int inf = 1 n2.c; } }; int ans, ans2; void prim(){ priority_queueque; while(!que.empty()) que.pop(); memset(mm, 0, sizeof(mm)); memset(pre, 0, sizeof(pre)); memset(used... 阅读全文
posted @ 2017-11-10 17:18 楼主好菜啊 阅读(220) 评论(0) 推荐(0) 编辑
摘要:const int inf = 1 n2.c; } }; int ans; void prim(){ priority_queueque; while(!que.empty()) que.pop(); memset(vis, false, sizeof(vis)); for(int i = 1; i >t; while(t--){ ... 阅读全文
posted @ 2017-11-10 16:21 楼主好菜啊 阅读(410) 评论(0) 推荐(0) 编辑
摘要:Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but 阅读全文
posted @ 2017-11-09 18:56 楼主好菜啊 阅读(206) 评论(0) 推荐(0) 编辑
摘要:const int inf = 1que; for(int i = 1; i d[i]){ d[i] = edge[v][i]; que.push(node(i, d[i])); } } } } int main() { int t; int a, b, ... 阅读全文
posted @ 2017-11-09 09:13 楼主好菜啊 阅读(214) 评论(0) 推荐(0) 编辑
摘要:Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whe 阅读全文
posted @ 2017-11-07 22:26 楼主好菜啊 阅读(624) 评论(0) 推荐(1) 编辑
摘要:While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path tha 阅读全文
posted @ 2017-11-05 09:58 楼主好菜啊 阅读(198) 评论(0) 推荐(0) 编辑
摘要:You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2 阅读全文
posted @ 2017-11-04 11:43 楼主好菜啊 阅读(730) 评论(0) 推荐(0) 编辑
摘要:在 c++ 的 stl 库中有封装好的 优先队列 1. 2 . 3. 模板: 阅读全文
posted @ 2017-11-03 11:58 楼主好菜啊 阅读(222) 评论(0) 推荐(0) 编辑
摘要:先看两种对vector 的赋值方法 1 . 2 . 板子 : 阅读全文
posted @ 2017-11-02 23:39 楼主好菜啊 阅读(236) 评论(0) 推荐(0) 编辑
摘要:先看段代码: 在结构体中 阅读全文
posted @ 2017-11-02 21:47 楼主好菜啊 阅读(330) 评论(0) 推荐(0) 编辑
摘要:Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Be 阅读全文
posted @ 2017-11-02 18:46 楼主好菜啊 阅读(219) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示