码迷,mamicode.com
首页 >  
搜索关键字:unsigned    ( 4409个结果)
UVA 12486 Space Elevator(数位DP)
题目pdf:http://acm.bnu.edu.cn/v3/external/124/12486.pdf 大致题意:求第n个不包含"4"和"13"为子串的数是多少 , n 思路:就是一般的数位DP,二分答案,对答案的数求数位DP算出此数以内有多少个满足条件的数 但是....居然答案爆long long,要用unsigned long long 才能过,就这个坑点 // ...
分类:其他好文   时间:2015-08-15 01:34:31    阅读次数:135
建立简单的哈希表
#include #include unsigned int SDBMHash(char *str) { unsigned int hash = 0; while (*str) { // equivalent to: hash = 65599*hash + (*str++); hash = (*str++) + (hash << 6) + (hash << 16) - hash;...
分类:其他好文   时间:2015-08-15 00:15:08    阅读次数:200
哈希运用于大数据查找中
使用哈希,实现6428633条CSDN账户数据的简单查询 #define _CRT_SECURE_NO_WARNINGS #include #include char path[256] = "E:\\Big_Data\\csdn.txt"; #define N 6428633 unsigned int BKDRHash(char *str); struct beitai { char...
分类:其他好文   时间:2015-08-15 00:12:36    阅读次数:170
malloc calloc 和 realloc
realloc()函数原型:extern void *realloc(void *mem_address, unsigned int newsize);语法:指针名=(数据类型*)realloc(要改变内存大小的指针名,新的大小)。头文件:#include 有些编译器需要#include ,在TC....
分类:其他好文   时间:2015-08-15 00:00:19    阅读次数:345
sizeof/strlen/length
1.sizeof() sizeof(...)是运算符,在头文件中typedef为unsigned int,其值在编译时即计算好了,参数可以是数组、指针、类型、对象、函数等。 它的功能是:获得保证能容纳实现所建立的最大对象的字节大小。 由于在编译时计算,因此sizeof不能用来返回动态分配的内存...
分类:其他好文   时间:2015-08-14 23:57:15    阅读次数:212
IOS小技巧整理
1 随机数的使用头文件的引用#import #import srandom()的使用srandom((unsigned)(mach_absolute_time() & 0xFFFFFFFF));直接使用random()来调用随机数2 在UIImageView 中旋转图像float rotateAng...
分类:移动开发   时间:2015-08-14 22:41:25    阅读次数:211
BZOJ 2795: [Poi2012]A Horrible Poem( hash )
...字符串hash.#includeusing namespace std;typedef unsigned long long ull;const int maxn = 500009;const ull P = 1000173169;char S[maxn];int check[maxn], p...
分类:其他好文   时间:2015-08-14 11:30:51    阅读次数:145
高效统计整数中 1 的比特数
输入一个无符号整数,统计该整数中含1的比特数。 #include int numbits(unsigned int n) { int count = 0; while(n>0){ n &= (n-1);//每次操作去掉n中最低位的1 count++; } return count; } int main() { unsigned int n; scanf("%d",&n)...
分类:其他好文   时间:2015-08-14 08:48:09    阅读次数:200
HDU--4821(字符串哈希)
#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long llu; const int maxd=1e5+5; const int seed=31; const int I...
分类:其他好文   时间:2015-08-13 22:19:15    阅读次数:152
c/c++中产生随机数
相关函数:rand()函数, srand()函数rand():返回一随机数值, 范围在0至RAND_MAX 间void srand (unsigned int seed):设置rand()产生随机数时的随机数种子。示例:#include#include#includevoid main(){ ...
分类:编程语言   时间:2015-08-13 21:52:16    阅读次数:160
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!