2011年4月19日

hdu max sum

摘要: 这题跟求最大连续数列一样的,稍微不同的是只要把值改为标号就可以了。#include<stdio.h>#include<string.h>#include<stdlib.h>#include<debug.h>#define X 100001int A[X];int main( ){ int N,M,a,b,c,d,e,f,x,i,y,sum,len=0; Debug(); scanf("%d",&N); while(N--) { len++; memset(A,0,sizeof(A)); scanf("%d&q 阅读全文

posted @ 2011-04-19 20:19 more think, more gains 阅读(188) 评论(0) 推荐(0) 编辑

hdu 命运

摘要: 这题一看思路跟数塔,天上掉馅饼一样,从后面往前推,不断比较,更新,就ok了。。发现自己的编程能力还有有待提高,思路那么明确,我编的速度真的有点慢,还出现了各种错误,死循环等等等。。加油,努力提高编程努力。。。。错误代码如下 :#include<stdio.h>#include<string.h>#include<stdlib.h>#include<debug.h>int A[21][1001],flag2=0,a1=-2000;int fun(int x ,int y){ return x>y? x:y;}int array(int x,i 阅读全文

posted @ 2011-04-19 20:14 more think, more gains 阅读(238) 评论(0) 推荐(0) 编辑

免费馅饼

摘要: 方法跟数塔一样。。#include<stdio.h>#include<string.h>#include<stdlib.h>#include<debug.h>int A[100010][11];int fun1(int x,int y){ return x>y?x:y;}int fun2(int x,int y,int z){ return fun1(fun1(x,y),z);}int main( ){ int N,i,j,k,point,t; //Debug(); while(scanf("%d",&N),N) 阅读全文

posted @ 2011-04-19 16:07 more think, more gains 阅读(188) 评论(0) 推荐(0) 编辑

导航