上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 51 下一页
摘要: 2011-12-21 02:04:56地址:http://acm.hdu.edu.cn/showproblem.php?pid=1716题意:中文。mark:dfs。代码:# include <stdio.h># include <algorithm>using namespace std ;int a[4], num[4], tab[10] ;int flag ;void dfs(int n){ int i ; if (n == 4) { if (flag == 0) flag = 1 ; else printf (" ") ; p... 阅读全文
posted @ 2012-01-06 23:20 Seraph2012 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 18:25:13HDOJ贰佰伍拾斩获。留念。最近做题很慢啊。而且各种犯2啊,而且各种不会啊。阻力好大啊。 阅读全文
posted @ 2012-01-06 23:19 Seraph2012 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 19:19:01地址:http://acm.hdu.edu.cn/showproblem.php?pid=1256题意:中文。mark:wa了一次,算横排长度的时候用h/6忘了+1。代码:# include <stdio.h># include <string.h>char g[110][110] ;void output (char ch, int h){ int a = (h-3) /2 , b = (h-2) /2 ; int c = 1 + h / 6 ; int i, j ; memset (g, ' ', sizeof 阅读全文
posted @ 2012-01-06 23:19 Seraph2012 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 18:17:43地址:http://acm.hdu.edu.cn/showproblem.php?pid=1194题意:已知两数和与两数差,求俩数。代码:# include <stdio.h>int main (){ int T, a, b ; scanf ("%d", &T) ; while (T--) { scanf ("%d%d", &a, &b) ; if (a < b || (a+b)%2 == 1) { puts ("impossible") ; contin 阅读全文
posted @ 2012-01-06 23:18 Seraph2012 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 18:23:34地址:http://acm.hdu.edu.cn/showproblem.php?pid=1197题意:输出所有符合条件的数字。条件就是4位数,用10进制表示的各个数码的和,等于16进制各数码的和,同时还等于12进制的。代码:# include <stdio.h>int test(int n, int b){ int sum = 0 ; while (n) { sum += n%b ; n/= b ; } return sum ;}int main (){ int i ; for (i ... 阅读全文
posted @ 2012-01-06 23:18 Seraph2012 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 17:20:41地址:http://acm.hdu.edu.cn/showproblem.php?pid=1098题意:给出k。求使得f(x)=5*x^13+13*x^5+k*a*x对任意x都为65的倍数的a的最小值。mark:65=13*5。要使f(x)是65的倍数,只需要f(x)是5和13的倍数即可。先来分析13的。若f(x)是13的倍数,有5*x^13+13*x^5+k*a*x % 13 == 0,其中13*x^5项显然不用考虑。则只需5*x^13 + k*a*x是13的倍数,即x*(5*x^12+k*a)是13的倍数。若x是13的倍数,不用考虑。若x不是13的倍数 阅读全文
posted @ 2012-01-06 23:17 Seraph2012 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 17:54:28地址:http://acm.hdu.edu.cn/showproblem.php?pid=1143题意:用2*1的砖铺3*n,有多少种方法。mark:递推。dp[n] = 4*dp[n-2]-dp[n-4]代码:# include <stdio.h>int dp[35] = {1, 0, 3, 0} ;int main (){ int i, n ; for (i = 4 ; i<= 30 ; i+= 2) dp[i] = 4*dp[i-2] - dp[i-4] ; while (~scanf ("%d", &n 阅读全文
posted @ 2012-01-06 23:17 Seraph2012 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 16:28:14地址:http://acm.hdu.edu.cn/showproblem.php?pid=1039题意:判断一个字符串是否能被接受。要满足:1.含有元音字母。2.不存在3个连续的元音字母或辅音字母。 3.不存在连续两个相同的字母,除非是'ee'或'oo'。代码:# include <stdio.h># include <string.h>char str[1010] ;int isvowels (char ch){ if (ch == 'a' || ch == 'e' 阅读全文
posted @ 2012-01-06 23:16 Seraph2012 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 16:07:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=2062题意:求n个数集合的第m个子序列,按字典序排序,也就是说1 2 < 1 2 3 < 1 3。代码:# include <stdio.h># include <string.h>typedef long long ll ;ll n, m, dp[25] = {0, 1} ;int visited[25] ;int flag ;void init(){ int i ; for (i = 2 ; i <= 20 ; i++) 阅读全文
posted @ 2012-01-06 23:15 Seraph2012 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 2011-12-20 16:13:50地址:http://acm.hdu.edu.cn/showproblem.php?pid=1037题意:输入一串数字,输出第一个小于168的数字。代码:# include <stdio.h>int main (){ int n ; while (~scanf ("%d", &n)) if (n < 168) break ; if (n < 168) printf ("CRASH %d\n", n) ; else printf ("NO CRASH\n") ; ret 阅读全文
posted @ 2012-01-06 23:15 Seraph2012 阅读(241) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 51 下一页