Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么这个能AC阿.In Reply To:一种解法. Posted by:silvere at 2006-03-23 00:59:13 for(int i=0;i<k;i++) { if(res<s[i]) res=s[i]; } 真可以,变量作用域。。。。 最外层循环和里面都敢用i.... p.s: 如果所有元素为负数,那这个res初始0是不是就错了? 另外,他最外层循环 i=0; j=(i+1) 而内层都有m=i;m<=j;这样的话,如果单行元素矩阵为最大值不就算不出来了 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator