码迷,mamicode.com
首页 >  
搜索关键字:strlen sizeof    ( 8171个结果
noip知识点总结之--线性筛法及其拓展
一、线性筛法众所周知。。。线性筛就是在O(n)的时间里找出所有素数的方法code:void get_prime(int N){ int i, j, k; memset(Flag, sizeof(Flag), 0); for (i = 2; i N) break; ...
分类:其他好文   时间:2014-11-01 13:25:26    阅读次数:152
codeforces 425D
题意:给定n=ty则统计vy[y][0]~vy[y][ty-1]的所有y是否符合。方法类似。 这样最坏情况下应该跟分块的复杂度差不多吧(不会证明)code: 1 #include 2 #define M0(x) memset(x, 0, sizeof(x)) 3 #define MP mak...
分类:其他好文   时间:2014-11-01 01:01:13    阅读次数:359
NYOJ108
//思路就是:数组第i项存储的是前i个(包括第i个)士兵的杀敌数#include<stdio.h>#include<stdlib.h>#include<string.h>intmain(){ intnum_of_soldiers,num_of_asks,from,to; inttotal_kills[100001]; inti,num_of_kills; memset(total_kills,0,sizeof(total..
分类:其他好文   时间:2014-10-31 19:20:20    阅读次数:126
Uva 1386 - Cellular Automaton ( 矩阵乘法 + 循环矩阵 )
Uva 1386 - Cellular Automaton ( 矩阵乘法 + 循环矩阵 )#include #include #define CLR( a, b ) memset( a, b, sizeof(a) )int MOD;#define MAX_SIZE 500struct Mat{ .....
分类:其他好文   时间:2014-10-31 18:43:10    阅读次数:202
Uva 11149 - Power of Matrix ( 矩阵快速幂 )
Uva 11149 - Power of Matrix ( 矩阵快速幂 )#include #include #define CLR( a, b ) memset( a, b, sizeof(a) )#define MOD 10#define MAX_SIZE 40struct Mat{ in...
分类:其他好文   时间:2014-10-31 15:31:42    阅读次数:193
数据结构实现之顺序表
所谓数据结构,就是定义一组有关系的数据以及在这些数据上的操作,也就是ADT(抽象数据类型)。       包括三个方面;      ADT List{ 数据对象:  数据关系:基本运算:}      以顺序表为例,它的顺序存储类型: typedef struct { ElemType data[MaxSize]; // ElemType存放数据类型 int length; }Sq...
分类:其他好文   时间:2014-10-31 13:53:30    阅读次数:161
PHP对IP地址和子网掩码的处理方法
ip2long IP地址转换成整型。 long2ip 整型数据转换成IP。 子网掩码转换成掩码长度方式: $slash_notation = strlen(preg_replace("/0/", "", decbin(ip2long($subnet_mask)))); $bits=strpos(decbin(ip2long($mas...
分类:Web程序   时间:2014-10-31 12:13:27    阅读次数:300
HDU 4472 DP
按图示方法,给出N个点,求一共有多少种组成方式 DP打表 #include "stdio.h" #include "string.h" int mod=1000000007; __int64 dp[1010][1010],sum[1010]; int main() { int i,j,k,Case,n; memset(dp,0,sizeof(dp)); me...
分类:其他好文   时间:2014-10-31 12:01:10    阅读次数:138
【出现次数最多的单词】
字典树== 1 #include 2 #include 3 #include 4 #include 5 #define mem0(a) memset(a, 0, sizeof(a)) 6 using namespace std; 7 char str[200000]; 8 struct Tr...
分类:其他好文   时间:2014-10-31 06:21:53    阅读次数:241
整理的一些PHP面试题目
1.strlen()和mb_strlen()的作用分别是什么?strlen()和mb_strlen()的作用都是来获取字符串的长度,其中strlen()只针对单字节编码字符,也就是计算字符串的总字节数,如果是多字节编码,如gbk和utf8,使用strlen()获得的不是字符总数而是总字节数,可以使用...
分类:Web程序   时间:2014-10-30 22:35:21    阅读次数:300
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!