2013年3月29日
摘要: View Code #include<stdio.h>#include<string.h>intmain(){chars[100000];intl,j;while(gets(s)!=NULL){inti=0;l=strlen(s);while(i<l){intj=0;intk=i;while(((s[i]>='A')&&(s[i]<='Z'))||((s[i]>='a')&&(s[i]<='z'))){j++;i++;}if(j>2)pri 阅读全文
posted @ 2013-03-29 23:03 Modiz 阅读(156) 评论(0) 推荐(0) 编辑
  2013年3月23日
摘要: View Code#include<stdio.h>#include<string.h>intn;inta[510][510];intlowbit(intx){returnx&(-x);}voidinc(intx,inty,intz){for(intj=x;j<=n;j+=lowbit(j))for(inti=y;i<=n;i+=lowbit(i))a[j][i]+=z;}longlongsum(intx,inty){longlongs=0;for(inti=x;i>=1;i-=lowbit(i))for(intj=y;j>=1;j-=l 阅读全文
posted @ 2013-03-23 16:42 Modiz 阅读(276) 评论(0) 推荐(0) 编辑
  2013年3月22日
摘要: 其实对于Matrix 我很喜欢看的一部电影《黑客帝国》...兴致勃勃的去做,哎~可惜却是我最痛恨的英文...蛋疼...黑客帝国Matrix VS zion 确实很不错...我弄了个电子版程序介绍,不错的哦~有兴趣的朋友可以去我空间日志去看看。http://user.qzone.qq.com/504281906/infocenter废话不多说,哎~最近逻辑混乱了,说话打字颠三倒四的...看了网上一些大神的结题报告才知道二维树状数组可以这样子打表...膜拜啊~~View Code 阅读全文
posted @ 2013-03-22 20:55 Modiz 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 哎~又有学到知识...不过是以翘课被抓为代价的...咕~~(╯﹏╰)bView Code#include<stdio.h>#include<stdlib.h>#include<string.h>__int64s;intm;__int64b[10050];structnode{intx;inty;};nodea[1000005];intcmp(constvoid*a,constvoid*b){if((*(node*)a).x==(*(node*)b).x)return(*(node*)a).y-(*(node*)b).y;return(*(node*)a).x 阅读全文
posted @ 2013-03-22 12:13 Modiz 阅读(128) 评论(0) 推荐(0) 编辑
  2013年3月20日
摘要: View Code#include<stdio.h>#include<string.h>intn;longlonga[50005],f,b[50005];chars[10];intlowbit(intt){returnt&(t^(t-1));}intsum(intend){ints=0;while(end>0){s+=b[end];end-=lowbit(end);}returns;}voidplu(intpos,intnum){while(pos<=n){b[pos]+=num;pos+=lowbit(pos);}}intmain(){intT,i 阅读全文
posted @ 2013-03-20 22:06 Modiz 阅读(128) 评论(0) 推荐(0) 编辑
  2013年3月16日
摘要: View Code#include<iostream>#include<cstring>#include<queue>usingnamespacestd;intx2,y2;intans=0;intdre_x[5]={0,-1,1,0,0};intdre_y[5]={0,0,0,-1,1};intmap[12][12];intvisit[12][12];classPoint{public:intx;inty;Point(intx,inty){this->x=x;this->y=y;}~Point(){}private:protected:};que 阅读全文
posted @ 2013-03-16 18:56 Modiz 阅读(222) 评论(0) 推荐(0) 编辑
  2013年3月11日
摘要: View Code#include<stdio.h>typedefstruct{intstack[100];inttop;}seqstack;voidstackinitiate(seqstack*s){s->top=0;}intstacknotempty(seqstacks){if(s.top<=0)return0;elsereturn1;}voidstackpush(seqstack*s,intx){s->stack[s->top]=x;s->top++;}voidstackpop(seqstack*s,int*x){s->top--;*x=s 阅读全文
posted @ 2013-03-11 21:27 Modiz 阅读(115) 评论(0) 推荐(0) 编辑
  2013年3月8日
摘要: View Code#include<stdio.h>#include<string.h>intmain(){intn,m,i,j;while(scanf("%d%d",&n,&m)!=EOF){int**a=newint*[n];for(i=1;i<=n;i++)a[i]=newint[m];for(i=1;i<=n;i++)for(j=1;j<=m;j++)a[i][j]=i*j;for(i=1;i<=n;i++){for(j=1;j<=m;j++)printf("%4d",a[i] 阅读全文
posted @ 2013-03-08 21:11 Modiz 阅读(149) 评论(0) 推荐(0) 编辑
  2013年1月11日
摘要: 老是忘记改怎么写...1#include<stdio.h>2#include<stdlib.h>3intcmp(constvoid*a,constvoid*b)4{5return*(int*)a-*(int*)b;6}7intmain()8{9intn,i,a[100];10scanf("%d",&n);11for(i=0;i<n;i++)12scanf("%d",&a[i]);13qsort(a,n,sizeof(a[0]),cmp);14for(i=0;i<n;i++)15printf(" 阅读全文
posted @ 2013-01-11 15:47 Modiz 阅读(144) 评论(0) 推荐(0) 编辑
  2013年1月10日
摘要: View Code1#include<stdio.h>2#include<string.h>3#defineN1000104__int64ol[N];5intzys[N][20],g[N];6voidoula()7{8inti,j;9ol[1]=1;10for(i=2;i<N;i++)11{12if(!ol[i])13{14for(j=i;j<N;j+=i)15{16if(!ol[j])17ol[j]=j;18ol[j]=ol[j]*(i-1)/i;19zys[j][g[j]++]=i;20}21}22ol[i]+=ol[i-1];23}24}25__int 阅读全文
posted @ 2013-01-10 21:38 Modiz 阅读(130) 评论(0) 推荐(0) 编辑