Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么这个能AC阿.

Posted by xjtudaniel at 2009-09-22 16:51:13 on Problem 1050 and last updated at 2009-09-22 17:10:16
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator