| 记录编号 |
253476 |
评测结果 |
AAAAAAAAAA |
| 题目名称 |
810.老师的工资 |
最终得分 |
100 |
| 用户昵称 |
NewBee |
是否通过 |
通过 |
| 代码语言 |
C++ |
运行时间 |
0.000 s |
| 提交时间 |
2016-04-22 10:46:46 |
内存使用 |
0.00 MiB |
显示代码纯文本
#include<cstdio>
#define Cu fclose(stdin);fclose(stdout);return 0;
#define Begin freopen("machinea.in","r",stdin);freopen("machinea.out","w",stdout);chul();Cu;
using namespace std;
//designed by New_Beeؼ
const int maxn=40;
int f[maxn][maxn];
int much[maxn][maxn];
void mem();
int chul(){
freopen("teacher.in","r",stdin);freopen("teacher.out","w",stdout);
mem();
int n,m;scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++)scanf("%d",&much[i][j]);
}
for(int i=1;i<=n;i++){
for(int j=0;j<=m;j++){
int t=0;
for(int k=0;k<=j;k++){
if(f[i][j]<f[i-1][k]+much[i][j-k]){
f[i][j]=f[i-1][k]+much[i][j-k];
}
}
}
}
printf("%d",f[n][m]);
}
void mem(){
for(int i=0;i<maxn;i++){
for(int j=0;j<maxn;j++){
f[i][j]=much[i][j]=0;
}
}
}
int mm=chul();
int main(){
;
}