摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 #include<stdlib.h> 5 using namespace std; 6 const int maxn = 205; 7 char a[ maxn ],b[ maxn ],s[ maxn ]; 8 char fi[ 505 ][ maxn ]; 9 char tmp[ maxn ]; 10 11 void a_b_add( ){ 12 int i,t,la,lb; 13 i=0; 14 阅读全文
posted @ 2013-02-05 22:06 xxx0624 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 打表找范围!View Code 1 #include<stdio.h> 2 int fac[ 12 ]; 3 void init(){ 4 fac[ 0 ]=1; 5 fac[ 1 ]=1; 6 fac[ 2 ]=2; 7 for( int i=3;i<=9;i++ ){ 8 fac[ i ]=fac[ i-1 ]*i; 9 }10 }11 void init2(){12 init();13 printf("1\n2\n");14 for( int i=145;i<=50000;i++ ){15 ... 阅读全文
posted @ 2013-02-05 21:53 xxx0624 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题意:给定n个点,n-1条边,每两个点之间的路独一无二LCAView Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 const int maxn = 40005; 5 int head[ maxn ],cnt; 6 struct node{ 7 int u,val,next; 8 }edge[ maxn*2 ]; 9 int ace[ maxn ],fa[ maxn ],dis[ maxn ],deep[ maxn ];10 void init(){11 cnt=0; 阅读全文
posted @ 2013-02-05 20:06 xxx0624 阅读(371) 评论(0) 推荐(0) 编辑