为什么全wa了,各位大神帮忙看看
查看原帖
为什么全wa了,各位大神帮忙看看
585011
__AlRTy__楼主2021/11/11 23:07
#include<cstdio>
#include<iostream>
#define For(a,b,c,d) for(int d=a;d<=b;d+=c)
using namespace std;
int n,s=-0e7,a[2002][2002],f[2002],b[2002];
int main() {
	cin>>n;
	For(1,n,1,i) {
		For(1,n,1,j) {
			scanf("%d",a+i+j);
		}
	}
	For(1,n,1,i) {
		For(i,n,1,j) {
			For(1,n,1,k) {
				b[k]+=a[j][k];
			}
			For(1,n,1,k) {
				f[k]=max(f[i-1]+b[k],b[k]);
				s=max(s,f[k]);
			}			
		}
		For(1,n,1,k) {
			f[k]=0;
		}
	}
	printf("%d",s);
	return 0;
}
2021/11/11 23:07
加载中...