摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2572题意:中文。mark:直接暴搞。1wa,注意要取字母序最小的,长度要先判断。代码: 1 # include <stdio.h> 2 # include <string.h> 3 4 5 char ans[110] ; 6 char s1[110], s2[110], s3[110] ; 7 char ss[110] ; 8 9 10 int find(char s[], char p[])11 {12 int i, j, len1 = strlen(s), len2 = s 阅读全文
posted @ 2012-05-03 05:41 Seraph2012 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1804题意:要把输入的英文字符串转化成复数的形式。mark:规则就是那4条。注意y的判断还要满足前一个字符不是元音字母(aeiou)就可以了。代码: 1 # include <stdio.h> 2 # include <string.h> 3 4 5 char dict[25][2][25] ; 6 int n, m ; 7 8 9 int find(char s[])10 {11 int i ;12 for (i = 0 ; i < n ; i++)13 if ... 阅读全文
posted @ 2012-05-03 05:01 Seraph2012 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1978题意:中文。mark:水题。可以dfs搞,也可以dp搞,此处是dp。写错下标wa了1次,忘记删调试信息ole一次。太2了。代码: 1 # include <stdio.h> 2 3 4 # define MOD 10000 5 6 7 int a[110][110], dp[110][110] ; 8 int n, m ; 9 10 11 int calc(int x, int y)12 {13 int i, j, rtn = 0 ;14 if (x == n-1 && 阅读全文
posted @ 2012-05-03 04:45 Seraph2012 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2184题意:中文。。。就是递归了。代码: 1 # include <stdio.h> 2 3 4 int n ; 5 long long m ; 6 7 8 int pil[3][70] ; 9 10 11 void gao(int a[], int b[], int c[])12 {13 long long mid = (1LL << (n-1)) ;14 if (n == 0) return ;15 if (m >= mid)16 {17 c[... 阅读全文
posted @ 2012-05-03 03:35 Seraph2012 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1997题意:中文。。。mark:生生递归就好了。代码: 1 # include <stdio.h> 2 3 4 int num[4] ; 5 int pil[4][70] ; 6 int n ; 7 8 9 int judge(int a[70], int b[70], int c[70], int na, int nb, int nc)10 {11 // printf ("%d\n", n) ;12 if (n == 0) return 1 ;13 if (na < 阅读全文
posted @ 2012-05-03 02:44 Seraph2012 阅读(206) 评论(0) 推荐(0) 编辑