码迷,mamicode.com
首页 >  
搜索关键字:c++ memset    ( 3691个结果
HDU 1243 DP
思路和1080一样 题目有几个坑: 范围要开到2010,题目没有给 子弹数量和恐怖分子出现的字符串长度不一定相等 用memset会超时 #include "stdio.h" #include "string.h" int dp[2010][2010],a[2010]; int Max(int a,int b,int c) { int...
分类:其他好文   时间:2014-11-04 11:06:16    阅读次数:163
ZOJ 2836 Number Puzzle ( 容斥原理 )
ZOJ 2836 Number Puzzle ( 容斥原理 )#include #include #include using namespace std;typedef long long LL;#define CLR( a, b ) memset( a, b, sizeof(a) )int m,...
分类:其他好文   时间:2014-11-03 23:57:57    阅读次数:387
memset函数具体说明
1。void *memset(void *s,int c,size_t n)总的作用:将已开辟内存空间 s 的首 n 个字节的值设为值 c。2。样例#includevoid main(){char *s="Golden Global View";clrscr();memset(s,'G',6);pr...
分类:其他好文   时间:2014-11-03 20:37:25    阅读次数:130
ZOJ 3687 The Review Plan I ( 禁位排列 + 容斥原理 )
ZOJ 3687 The Review Plan I ( 禁位排列 + 容斥原理 )#include #include #include using namespace std;typedef long long LL;#define CLR( a, b ) memset( a, b, sizeof...
分类:其他好文   时间:2014-11-03 16:10:46    阅读次数:270
codeforces 424D
题意:给定n,m 2 #define M0(x) memset(x, 0, sizeof(x)) 3 #define repf(i, a, b) for(int i = (a); i = (b); --i) 5 using namespace std; 6 int U[303][303], D[30...
分类:其他好文   时间:2014-11-01 20:21:59    阅读次数:299
codeforces 425C
题意:给定长度为n,m 2 using namespace std; 3 #define vii vector::iterator 4 #define M0(a) memset(a, 0, sizeof(a)) 5 #define repf(i, a, b) for (int i = (a); i ...
分类:其他好文   时间:2014-11-01 16:04:36    阅读次数:194
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!