/ Randle /

记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Accepted 2ms 196.0 KiB
#2 Accepted 1ms 200.0 KiB
#3 Accepted 8ms 324.0 KiB
#4 Accepted 8ms 328.0 KiB
#5 Accepted 400ms 344.0 KiB
#6 Accepted 377ms 332.0 KiB
#7 Time Exceeded ≥1000ms ≥320.0 KiB
#8 Time Exceeded ≥1002ms ≥328.0 KiB
#9 Time Exceeded ≥1000ms ≥320.0 KiB
#10 Time Exceeded ≥1000ms ≥328.0 KiB

代码

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,j,k) for (int i=j;i<=k;i++)
#define dep(i,j,k) for (int i=j;i>=k;i--)
#define M(a,b) memset(a,b,sizeof(a))
using namespace std;
int n,m,p,ans,minn,zuixiao[70][70][70][70];
int sum[70][70],num[70][70],tot;
int main(){
	//freopen("puzzle.in","r",stdin);
//    freopen("puzzle.out","w",stdout);
	ans=-2e9;
    scanf("%d%d%d",&n,&m,&p);
    rep(i,1,n)
    	rep(j,1,m) scanf("%d",&num[i][j]);
	rep(i,1,n)
    	rep(j,1,m) sum[i][j]=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+num[i][j]; 
    rep(i,1,n)
    	rep(j,1,m)
    		rep(k,i,n)
    			rep(l,j,m){
                	tot=sum[k][l]-sum[i-1][l]-sum[k][j-1]+sum[i-1][j-1];
                    minn=2e9;
                    rep(a,i,k)
                        rep(b,j,l) minn=min(minn,num[a][b]);
                    if(minn<p) tot=tot-minn+p;
                    ans=max(ans,tot);
                }
    printf("%d",ans);
	return 0;
}

信息

递交者
类型
递交
题目
解密游戏 T3
题目数据
下载
语言
C++
递交时间
2019-11-09 19:06:21
评测时间
2019-11-09 19:06:21
评测机
分数
60
总耗时
≥4802ms
峰值内存
≥344.0 KiB