上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1232View Code 1 #include <stdio.h> 2 #include<string.h> 3 int father[1001]; 4 int find(int x) 5 { 6 if(x!=father[x]) 7 father[x] = find(father[x]); 8 return father[x]; 9 }10 void merge(int x,int y)11 {12 int fx, fy ;13 fx = find(x) ;14 ... 阅读全文
posted @ 2013-02-21 10:02 yelan@yelan 阅读(126) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1247View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 char c[50010][110] ; 5 struct node 6 { 7 int flag ; 8 struct node *next[26] ; 9 };10 struct node *creat()11 {12 int i ;13 struct node *p ;14 p = (struct node*)... 阅读全文
posted @ 2013-02-20 19:42 yelan@yelan 阅读(167) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1500&cid=1147View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<malloc.h> 4 int num ; 5 struct node 6 { 7 int flag; 8 struct node *next[26]; 9 };10 struct node *creat()11 {12 int i;13 struct node *p;14 p=(struct nod.. 阅读全文
posted @ 2013-02-20 13:46 yelan@yelan 阅读(164) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2137&cid=1145View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<malloc.h> 4 typedef struct tree 5 { 6 char data ; 7 struct tree *l, *r ; 8 }tree ; 9 tree *creat(char *root, char *in, int k ) 10 { 11 ... 阅读全文
posted @ 2013-02-19 20:41 yelan@yelan 阅读(277) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2136&cid=1145View Code 1 #include<stdio.h> 2 #include<malloc.h> 3 typedef struct node 4 { 5 char data ; 6 struct node *l, *r ; 7 }tree ; 8 tree *t ; 9 tree *creat(tree *t) 10 { 11 char c ; 12 if((c = get... 阅读全文
posted @ 2013-02-19 20:38 yelan@yelan 阅读(198) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2126View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 int cmp(const void *a, const void *b) 4 { 5 return(*(int*)b - *(int*)a) ; 6 } 7 int main() 8 { 9 int n, m, i,a[100001] ;10 while(scanf("%d %d", &a 阅读全文
posted @ 2013-02-19 20:32 yelan@yelan 阅读(182) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2128View Code 1 #include<stdio.h> 2 #include<malloc.h> 3 typedef struct tree 4 { 5 int data; 6 struct tree *l,*r; 7 }tree; 8 int k; 9 void creat(tree *t,int a) 10 { 11 tree *p; 12 p = ... 阅读全文
posted @ 2013-02-19 19:16 yelan@yelan 阅读(421) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1087View Code 1 #include<stdio.h> 2 #include<math.h> 3 int a[1100], dp[1100] ; 4 int main() 5 { 6 int n, i, j, max , m ; 7 while(scanf("%d", &n),n!=0) 8 { 9 for(i=0; i<n; i++)10 scanf("%d", &a[i]) ;11 dp[0] = 0 ;12 阅读全文
posted @ 2013-01-30 20:00 yelan@yelan 阅读(108) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1159View Code 1 #include<iostream> 2 #include<cstring> 3 using namespace std ; 4 char str1[10000] ; 5 char str2[10000] ; 6 int c[10000][10000] ; 7 int main() 8 { 9 int len1, len2, i, j ;10 while(cin>>str1>>str2)11 {12 len1 = strlen(st 阅读全文
posted @ 2013-01-30 19:57 yelan@yelan 阅读(157) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=1299View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define Max 1000 4 int b[Max+10] ; 5 int maxlen[Max+10] ; 6 int main() 7 { 8 int m, n, i, j ; 9 scanf("%d", &n) ;10 for(i=1; i<=n; i++)11 s 阅读全文
posted @ 2013-01-30 19:48 yelan@yelan 阅读(113) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页