QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#319586#7120. SoccerlgvcCompile Error//C++141.5kb2024-02-02 20:52:402024-04-28 08:37:21

Judging History

你现在查看的是最新测评结果

  • [2024-04-28 08:37:21]
  • 管理员手动重测本题所有提交记录
  • [2024-02-02 20:52:40]
  • 评测
  • [2024-02-02 20:52:40]
  • 提交

answer

#include "soccer.h"
#include <bits/stdc++.h>
int dp[509][509][509],dp2[509][509][509],la[2009][2009];
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
	memset(dp,-0x3f,sizeof(dp));
	int cq=0;
	for(int i=1;i<=N;i++) {
		int ll=N+1;
		for(int j=N;j>=1;j--) {
			if(F[i-1][j-1]) ll=j;
			if(F[i-1][j-1]) {
				cq++;x=i;y=j;
			}
			la[i][j]=ll;
		}
	}
	if(cq==1) {
		return std::max(std::max((x-1)*N,(N-x)*N),std::max((y-1)*N,(N-y)*N));
	}
/*	for(int i=1;i<=N;i++) {
		std::vector<int> vq;
		for(int j=1;j<=N;j++) {
			if(!F[i-1][j-1]) {
				vq.push_back(F[i-1][j-1]);
			}
		}
	}*/
	for(int i=1;i<=N;i++) {
		for(int j=1;j<=N;j++) {
			if(F[i-1][j-1]) continue;
			dp[i][i][j]=la[i][j]-1;
			dp2[i][i][j]=la[i][j]-j;
		}
	}
	int as=0;
	for(int l=1;l<=N;l++) {
		for(int i=1;i+l-1<=N;i++) {
			int j=i+l-1;
			for(int k=1;k<=N;k++) {
				as=std::max(as,dp2[i][j][k]);
				if(k>1&&dp[i][j][k]==dp[i][j][k-1]) continue;
				if(dp2[i][j][k]<0) continue;
				int x=dp[i][j][k];
				for(int l=k;l<=x;l++) {
					int z1=0,z2=0;
					if(i!=1&&F[i-2][l-1]==0) {
						dp[i-1][j][l]=std::max(dp[i-1][j][l],std::min(x,la[i-1][l]-1));
						dp2[i-1][j][l]=std::max(dp2[i-1][j][l],dp2[i][j][k]+std::min(x,la[i-1][l]-1)-l+1);
					}
					if(j!=N&&F[j][l-1]==0) {
						dp[i][j+1][l]=std::max(dp[i][j+1][l],std::min(x,la[j+1][l]-1));
						dp2[i][j+1][l]=std::max(dp2[i][j+1][l],dp2[i][j][k]+std::min(x,la[j+1][l]-1)-l+1);
					}
				}
			}
		}
	}
    return as;
}

詳細信息

answer.code: In function ‘int biggest_stadium(int, std::vector<std::vector<int> >)’:
answer.code:12:38: error: ‘x’ was not declared in this scope
   12 |                                 cq++;x=i;y=j;
      |                                      ^
answer.code:12:42: error: ‘y’ was not declared in this scope
   12 |                                 cq++;x=i;y=j;
      |                                          ^
answer.code:18:43: error: ‘x’ was not declared in this scope
   18 |                 return std::max(std::max((x-1)*N,(N-x)*N),std::max((y-1)*N,(N-y)*N));
      |                                           ^
answer.code:18:69: error: ‘y’ was not declared in this scope
   18 |                 return std::max(std::max((x-1)*N,(N-x)*N),std::max((y-1)*N,(N-y)*N));
      |                                                                     ^