2012年4月7日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4150查找不重复字串View Code #include <stdio.h>#include <string.h> #include <stdlib.h>#include <math.h>char a[1100000],b[10]; int main() { int t,ans; int len1,len2; int cnt; scanf("%d%*c",&t); while(t--) { scanf("%s%s%*c&qu 阅读全文
posted @ 2012-04-07 22:15 LegendaryAC 阅读(225) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4144数字对应1,字母对应0,五位一算。View Code #include <stdio.h>#include <string.h> #include <stdlib.h>int pow(int a,int b) { int i,s=1; for(i=0;i<b;i++) s*=a; return s; }char a[11000]; char tab[30]={'A','B','C','D',' 阅读全文
posted @ 2012-04-07 21:24 LegendaryAC 阅读(220) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1166线段树,单点增减,区间求和View Code #include <stdio.h>#include <string.h> #include <stdlib.h>#include <math.h>#define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 const int maxn=51000; int sum[maxn<<2]; int nCase=1; int pushup(i 阅读全文
posted @ 2012-04-07 20:03 LegendaryAC 阅读(151) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=172016进制输入,10进制输出View Code #include <stdio.h>#include <string.h> #include <stdlib.h>#include <math.h>int main() { int a,b; while(~scanf("%x%x",&a,&b)) printf("%d\n",a+b); return 0; } 阅读全文
posted @ 2012-04-07 16:45 LegendaryAC 阅读(217) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1754线段树,单点更新,区间最值。学习自http://www.notonlysuccess.com/index.php/segment-tree-complete/View Code #include <stdio.h>#include <string.h> #include <stdlib.h>#include <math.h>#define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 const 阅读全文
posted @ 2012-04-07 13:27 LegendaryAC 阅读(114) 评论(0) 推荐(0) 编辑