QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#319585 | #7120. Soccer | lgvc | Compile Error | / | / | C++14 | 1.5kb | 2024-02-02 20:52:08 | 2024-04-28 08:37:18 |
Judging History
你现在查看的是最新测评结果
- [2024-04-28 08:37:18]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-02-02 20:52:08]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-02-02 20:52:08]
- 提交
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)*M,(N-x)*M),std::max((y-1)*N,(M-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)*M,(N-x)*M),std::max((y-1)*N,(M-y)*N)); | ^ answer.code:18:48: error: ‘M’ was not declared in this scope 18 | return std::max(std::max((x-1)*M,(N-x)*M),std::max((y-1)*N,(M-y)*N)); | ^ answer.code:18:69: error: ‘y’ was not declared in this scope 18 | return std::max(std::max((x-1)*M,(N-x)*M),std::max((y-1)*N,(M-y)*N)); | ^