| 比赛 | 20240913练习 | 评测结果 | RRRRRRRRRR |
|---|---|---|---|
| 题目名称 | 牛宫 | 最终得分 | 0 |
| 用户昵称 | KKZH | 运行时间 | 2.074 s |
| 代码语言 | C++ | 内存使用 | 3.08 MiB |
| 提交时间 | 2024-09-13 21:08:45 | ||
#include<bits/stdc++.h>
using namespace std;
int f[300][300]={0},b=-INT_MAX;
int main(){
// freopen("long.in","r",stdin);
// freopen("long.out","w",stdout);
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++){
for(int j=1,x;j<=m;j++){
cin>>x;
f[i][j]=f[i][j-1]+f[i-1][j]-f[i-1][j-1]+x;
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
b=max(b,f[i][j]);
}
}
cout<<b;
}