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 |
我是来拉仇恨贴代码的const int MAXV = 101; int n,a[MAXV][MAXV],sum[MAXV][MAXV]; int main() { while(IN(n)) { MEM(sum,0); FOR(i,1,n) FOR(j,1,n) { IN(a[i][j]); sum[i][j]=a[i][j]+sum[i][j-1]; } int ans=0,temp=0; FOR(j,0,n) FOR(k,j,n) { temp=0; FOR(i,1,n) { temp+=sum[i][k]-sum[i][j]; ans=max(ans,temp=max(temp,0)); } } OL(ans); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator