上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 34 下一页

2012年9月2日

hdu 2602 Bone Collector (01背包)

摘要: 点击打开链接 #include #include int max(int a,int b) { return a>b?a:b; } int main() { int t,i,j,n,V,price[1001],volume[1001],v[1001]; scanf("%d",&t); ... 阅读全文

posted @ 2012-09-02 09:27 Slege 阅读(102) 评论(0) 推荐(0) 编辑

hdu 2078 复习时间 (水。。)

摘要: 点击打开链接 #include int main() { int t,n,m,i,min,a; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); min=100; for(i=0;i<n;i++) { scanf(... 阅读全文

posted @ 2012-09-02 09:26 Slege 阅读(111) 评论(0) 推荐(0) 编辑

hdu 3809 Decrypt coordinate (水。。)

摘要: 点击打开链接 PS:题目意思:让你求解方程: x1=x-sqrt(y); y1=y-sqrt(x); 已知x1,y1,要求x与y,精确到小数点后6位。 解题思路; 迭代法,式子是这样推的: x=x1+sqrt(y); y=y1+sqrt(x); 然后一开始把y=y1,x=x1赋值上去迭代,因... 阅读全文

posted @ 2012-09-02 09:26 Slege 阅读(227) 评论(0) 推荐(0) 编辑

hdu2123 An easy problem (水。)

摘要: 点击打开链接 #include int main() { int i,j,n,t; scanf("%d",&t); while(t--) { scanf("%d",&n); for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { ... 阅读全文

posted @ 2012-09-02 09:25 Slege 阅读(135) 评论(0) 推荐(0) 编辑

hdu 2524 矩形A + B (找规律)

摘要: 点击打开链接 PS:找规律, 有n行和m列。 如果只看一行的话,它有多少个矩形呢?单个地数有m个,两个地数有m-1个……,m个地数有1个。每一行就有:1+2+3+……+m个=(1+m)*m/2。 我们把每一行抽象成一个矩形,也就只剩一列了。一列的话,有:1+2+……+n=(1+n)*n... 阅读全文

posted @ 2012-09-02 09:25 Slege 阅读(134) 评论(0) 推荐(0) 编辑

hdu 1877 又一版 A+B (水)

摘要: 点击打开链接 PS:wrong了一次,没注意0+0的情况,本题为简单的进制转换 #include #include int main() { int a,b,m,k; char s[222]; while(scanf("%d%d%d",&m,&a,&b),... 阅读全文

posted @ 2012-09-02 09:24 Slege 阅读(113) 评论(0) 推荐(0) 编辑

hdu 1555 How many days? (模拟)

摘要: 点击打开链接 #include #include int main() { int m,k,cnt,day; while(scanf("%d%d",&m,&k)!=EOF&&m!=0||k!=0) { cnt=0;day=0; while(... 阅读全文

posted @ 2012-09-02 09:24 Slege 阅读(104) 评论(0) 推荐(0) 编辑

hdu 1161 Eddy's mistakes (strlwr与strupr的运用)

摘要: 点击打开链接 PS:string函数中的strlwr的运用,strlwr(将字符串中的字母转换为小写) strupr(转换为大写) #include #include int main() { char str[1111]; while(gets(str)) { strlwr(str... 阅读全文

posted @ 2012-09-02 09:23 Slege 阅读(170) 评论(0) 推荐(0) 编辑

hdu 3105 Fred's Lotto Tickets (水)

摘要: 点击打开链接 PS:题目意思是判断输入的数字是否将1-49全包含进去,如果说输出Yes 否则 No #include #include int main() { int i,j,n,a[111][6],aa[50]; while(scanf("%d",&n),n!=0) { fo... 阅读全文

posted @ 2012-09-02 09:22 Slege 阅读(123) 评论(0) 推荐(0) 编辑

hdu 2575 Count Problem (水)

摘要: 点击打开链接 PS:题目很简单,找到规律然后用数组储存,本体笔下误错了一次! #include #include int main() { int t,n,a[10]={0,1,2,2,4,4,6,6,10,10}; scanf("%d",&t); whi... 阅读全文

posted @ 2012-09-02 09:22 Slege 阅读(88) 评论(0) 推荐(0) 编辑

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 34 下一页

导航