码迷,mamicode.com
首页 >  
搜索关键字:bits    ( 3873个结果
kmp
#include <bits/stdc++.h>#define MAXN 100000using namespace std;string a, b;int next[MAXN]; //****a为主串,b为模式串void get_next(void) //***获得next数组{ next[0] ...
分类:其他好文   时间:2016-09-15 00:56:11    阅读次数:163
CF #371 (Div. 2) C、map标记
1、CF #371 (Div. 2) C. Sonya and Queries map应用,也可用trie 2、总结:一开始直接用数组遍历,果断T了一发 题意:t个数,奇变1,偶变0,然后与问的匹配。 #include<bits/stdc++.h> #define max(a,b) a>b?a:b ...
分类:其他好文   时间:2016-09-14 23:06:32    阅读次数:220
HDU5869树状数组+gcd预处理
比赛的时候知道用树状数组,但有点乱不知道怎么处理。 统计不同的gcd的个数其实就是用树状数组统计区间内不同的数的模板题啊... 复杂度O(nlogn) 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int N = 1e5+10; ...
分类:编程语言   时间:2016-09-14 20:37:31    阅读次数:248
190. Reverse Bits
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur ...
分类:其他好文   时间:2016-09-14 12:48:40    阅读次数:129
LeetCode-Reverse Bits
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur ...
分类:其他好文   时间:2016-09-14 01:45:00    阅读次数:127
利用id来进行树状数组,而不是离散化以后的val HDU 4417 离线+树状数组
题目大意:给你一个长度为n的数组,问[L,R]之间<=val的个数 思路:就像标题说的那样就行了。树状数组不一定是离散化以后的区间,而可以是id //看看会不会爆int!数组会不会少了一维! //取物问题一定要小心先手胜利的条件 #include <bits/stdc++.h> using name ...
分类:编程语言   时间:2016-09-14 00:16:22    阅读次数:252
191. Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit ...
分类:其他好文   时间:2016-09-12 10:52:56    阅读次数:105
关于java.util包下的Random类
1.功能:此类的实例用于生成伪随机数流 2.方法(Random的方法有很多,在此只解释说明我认为比较常用的几个方法) (1)next(int bits):生成下一个伪随机数 (2)nextDouble():返回下一个伪随机数,它是取自此随机数生成器序列的、在 0.0(包括) 和 1.0(不包括) 之 ...
分类:编程语言   时间:2016-09-10 22:08:43    阅读次数:175
191. Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight). For example, the 32-bit i ...
分类:其他好文   时间:2016-09-10 06:38:39    阅读次数:162
HDU5845 Best Division
递归写法,好久不写很容易就gg了... dp[i]=max(dp[j])+1,并且s[i]XORs[j]<=x 01字典树优化一下转移。 1 #include <bits/stdc++.h> 2 #define ll long long 3 using namespace std; 4 5 cons ...
分类:其他好文   时间:2016-09-08 18:20:29    阅读次数:164
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!