上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 51 下一页
摘要: 2011-12-15 06:49:09地址:http://acm.hdu.edu.cn/showproblem.php?pid=2134题意:把直径为R的圆平均分为3份,问r1和r2。简单数学。代码:# include <stdio.h># include <math.h>int main (){ int R ; while (~scanf ("%d", &R)) { if (R <= 0) break ; printf ("%.3lf %.3lf\n", R/sqrt(3), R*sqrt(2.0/3.0)) ; 阅读全文
posted @ 2012-01-06 15:53 Seraph2012 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 06:24:51地址:http://acm.hdu.edu.cn/showproblem.php?pid=2031题意:中文。。。又见进制转换。代码:# include <stdio.h>void output (int n, int r){ char tab[] = "0123456789ABCDEFGHIJK" ; if (n == 0) return ; output (n/r,r) ; putchar (tab[n%r]) ;}int main (){ int n, r ; while (~scanf ("%d%d&quo 阅读全文
posted @ 2012-01-06 15:52 Seraph2012 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 06:08:10地址:http://acm.hdu.edu.cn/showproblem.php?pid=2023题意:中文。。。mark:这题wa了3次!!!脑袋混乱了,把/m和/n写反了。代码:# include <stdio.h>double stu[60], cls[10] ;int a[60][10] ;int main (){ int n, m, i, j, num; while (~scanf ("%d%d", &n, &m)) { for (i = 0 ; i < n ; i++) stu[i] = 0 阅读全文
posted @ 2012-01-06 15:51 Seraph2012 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 06:20:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=2045题意:中文。mark:递推。wa了1次。没考虑n=3的时候还不满足递推公式,因为n=3的时候,dp[i-2]不存在与首位不同的情况。n=4的时候才开始满足公式dp[i] = dp[i-2]*2 + dp[i-1]。代码:# include <stdio.h>long long dp[55] = {0, 3, 6, 6} ;int main(){ int i, n ; for (i = 4 ; i <= 50 ; i++) dp[i] ... 阅读全文
posted @ 2012-01-06 15:51 Seraph2012 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 05:44:21地址:http://acm.hdu.edu.cn/showproblem.php?pid=1018题意:问n!有多少位。mark:网上大部分是斯特林公式。因为n!位数=log10(n!)+1,而log10(n!) = log10(1)+log10(2)+...+log10(n),亦勉强能解。1000ms的题跑900+ms,危险~。代码:# include <stdio.h># include <math.h>/*int calc(int nn){ double n = nn ; double Pi = acos(-1) ; int 阅读全文
posted @ 2012-01-06 15:50 Seraph2012 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 05:20:44地址:http://acm.hdu.edu.cn/showproblem.php?pid=2091题意:中文,模拟。mark:2B了,数组开成了50*50。。。wa了2次。代码:# include <stdio.h># include <string.h>char g[50][100] ;int main (){ char ch ; int i, num, a, b ; int flag = 0 ; while (~scanf ("%c", &ch)) { if (ch == '@') b 阅读全文
posted @ 2012-01-06 15:46 Seraph2012 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 05:08:51地址:http://acm.hdu.edu.cn/showproblem.php?pid=2064题意:中文。。。mark:递推。dp[i] = dp[i-1]*3+2。代码:# include <stdio.h>long long dp[40] = {0, 2} ;int main (){ int i, n ; for (i = 2 ; i <= 35 ;i ++) dp[i] = dp[i-1]*3 + 2 ; while (~scanf ("%d", &n)) { printf ("%I64d\ 阅读全文
posted @ 2012-01-06 15:42 Seraph2012 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 05:02:51地址:http://acm.hdu.edu.cn/showproblem.php?pid=2056题意:给2个矩阵的对角线坐标,求相交面积。计算几何。代码:# include <stdio.h>double max(double a, double b){return a>b?a:b;}double min(double a, double b){return a<b?a:b;}double gao(double a, double b, double c, double d){ double x = max(a,c) ; doub 阅读全文
posted @ 2012-01-06 15:41 Seraph2012 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 04:54:11地址:http://acm.hdu.edu.cn/showproblem.php?pid=1406题意:中文,找完数。mark:打表,范围内只有4个完数:6、28、496、8128。代码:# include <stdio.h>int main (){ int i, t, a, b, sum ; int tab[4] = {6, 28, 496, 8128} ; scanf ("%d", &t) ; while (t--) { scanf ("%d%d", &a, &b) ; if 阅读全文
posted @ 2012-01-06 15:40 Seraph2012 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 04:45:53地址:http://acm.hdu.edu.cn/showproblem.php?pid=1877题意:中文。又见进制转换。代码:# include <stdio.h>void output(int n, int m){ if (n == 0) return ; output (n/m, m) ; printf ("%d", n%m) ;}int main (){ int m, a, b ; while (~scanf ("%d", &m) && m) { scanf (" 阅读全文
posted @ 2012-01-06 15:39 Seraph2012 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 51 下一页