上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 51 下一页
摘要: 2011-12-16 04:59:45地址:http://acm.hdu.edu.cn/showproblem.php?pid=2027题意:中文。代码:# include <stdio.h># include <string.h>char str[110] ;int main (){ int i, T, nCase = 1 ; char tabstr[] = "aeiou" ; int tab[300] ; scanf ("%d%*c", &T) ; while (T--) { gets(str) ; memset (t 阅读全文
posted @ 2012-01-06 17:07 Seraph2012 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:54:26地址:http://acm.hdu.edu.cn/showproblem.php?pid=2098题意:中文,水。直接爆。代码:# include <stdio.h># include <math.h>int IsPrime(int n){ int i, lim = (int)sqrt(n)+1 ; if (n == 2 || n == 3) return 1 ; for (i = 2 ; i <= lim ; i++) if (n % i == 0) return 0 ; return 1 ;}int calc(in... 阅读全文
posted @ 2012-01-06 17:06 Seraph2012 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:45:58地址:http://acm.hdu.edu.cn/showproblem.php?pid=2028题意:中文。代码:# include <stdio.h>int gcd(int a, int b){return a%b?gcd(b,a%b):b;}int lcm(int a, int b){return a/gcd(a,b)*b;}int main (){ int n, num, ans ; while (~scanf ("%d", &n)) { ans = 1 ; while (n--) { ... 阅读全文
posted @ 2012-01-06 17:04 Seraph2012 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:48:40地址:http://acm.hdu.edu.cn/showproblem.php?pid=2503题意:中文。水。代码:# include <stdio.h>int gcd(int a, int b){return a%b?gcd(b,a%b):b;}int main (){ int T ; int a, b, c, d, e, f, g ; scanf ("%d", &T) ; while (T--) { scanf ("%d%d%d%d", &a, &b, &c, &a 阅读全文
posted @ 2012-01-06 17:04 Seraph2012 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:39:01地址:http://acm.hdu.edu.cn/showproblem.php?pid=2084题意:中文~经典dp。代码:# include <stdio.h>int dp[110][110] ;int max(int a, int b){return a>b?a:b;}int main (){ int T, n, i, j ; scanf ("%d", &T) ; while (T--) { scanf ("%d", &n) ; for (i = 1 ; i <= n ; 阅读全文
posted @ 2012-01-06 17:01 Seraph2012 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:43:08地址:http://acm.hdu.edu.cn/showproblem.php?pid=2025题意:中文。mark:wa了一次。pos = 0写成了pos = 1。代码:# include <stdio.h>char str[110] ;int main (){ int i, pos ; while (gets(str)) { pos = 0 ; for(i = 1 ; str[i] ; i++) if (str[i] > str[pos]) pos = i ; for ... 阅读全文
posted @ 2012-01-06 17:01 Seraph2012 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:34:56地址:http://acm.hdu.edu.cn/showproblem.php?pid=2161题意:判断是不是素数。在这题中2不算素数。mark:数据较小,直接暴。wa了一次,没注意结束条件是n<=0而不是n==0。代码:# include <stdio.h>int test(int n){ int i ; if (n <=2) return 0 ; for (i = 2 ; i < n ; i++) if (n%i == 0) return 0 ; return 1 ;}int main (){ int n... 阅读全文
posted @ 2012-01-06 16:59 Seraph2012 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:29:08地址:http://acm.hdu.edu.cn/showproblem.php?pid=2113题意:中文。代码:# include <stdio.h>int calc(int n){ int sum = 0 ; while(n) { if ((n&1) == 0) sum += (n%10) ; n/=10 ; } return sum ;}int main (){ int n , flag = 0 ; while (~scanf ("%d", &n)) ... 阅读全文
posted @ 2012-01-06 16:58 Seraph2012 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:24:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=2154题意:中文。mark:简单递推。dp[i] = dp[i-1]+dp[i-2]*2。注意取mod。代码:# include <stdio.h>int dp[1010] = {1, 0} ;int main (){ int i ; for (i = 2 ; i<= 1000 ; i++) dp[i] = (dp[i-1] + dp[i-2]*2) % 10000 ; while (~scanf ("%d", &i) 阅读全文
posted @ 2012-01-06 16:57 Seraph2012 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 04:16:12地址:http://acm.hdu.edu.cn/showproblem.php?pid=2092题意:中文。mark:可以搜,但是慢。可以配方后得:若n*n-4*m为完全平方数,有解,否则无解。代码:# include <stdio.h># include <math.h>int test(int n, int m){ int buf = n*n-4*m ; int p = sqrt(n*n-4*m) ; if (buf < 0) return 0 ; return (p*p == n*n-4*m) ;}int main ( 阅读全文
posted @ 2012-01-06 16:56 Seraph2012 阅读(169) 评论(0) 推荐(0) 编辑
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 51 下一页