#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
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
比赛的时候知道用树状数组,但有点乱不知道怎么处理。 统计不同的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
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
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
题目大意:给你一个长度为n的数组,问[L,R]之间<=val的个数 思路:就像标题说的那样就行了。树状数组不一定是离散化以后的区间,而可以是id //看看会不会爆int!数组会不会少了一维! //取物问题一定要小心先手胜利的条件 #include <bits/stdc++.h> using name ...
分类:
编程语言 时间:
2016-09-14 00:16:22
阅读次数:
252
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
1.功能:此类的实例用于生成伪随机数流 2.方法(Random的方法有很多,在此只解释说明我认为比较常用的几个方法) (1)next(int bits):生成下一个伪随机数 (2)nextDouble():返回下一个伪随机数,它是取自此随机数生成器序列的、在 0.0(包括) 和 1.0(不包括) 之 ...
分类:
编程语言 时间:
2016-09-10 22:08:43
阅读次数:
175
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
递归写法,好久不写很容易就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