QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#163885 | #7120. Soccer | Lynkcat | 0 | 1ms | 10004kb | C++20 | 1.8kb | 2023-09-04 16:07:27 | 2024-04-28 07:04:56 |
Judging History
answer
#include "soccer.h"
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < short,short >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
// #define int ll
#define N 2005
using namespace std;
namespace
{
int dp[N][N];
short pos[N][N];
short L[N][N],R[N][N];
}
int biggest_stadium(int n, std::vector<std::vector<int>> aa)
{
int ans=0;
vector<vector<pa>>tong(n+1,vector<pa>());
for (int j=1;j<=n;j++)
{
for (int i=1;i<=n;i++)
{
dp[i][j]=0;
if(aa[i-1][j-1]) pos[i][j]=i;
else pos[i][j]=pos[i-1][j];
tong[i-pos[i][j]].push_back(mp(i,j));
}
}
for (int i=1;i<=n;i++)
{
L[i][0]=0;
for (int j=2;j<=n;j++)
if (aa[i-1][j-2]) L[i][j]=j-1;else L[i][j]=L[i][j-1];
R[i][n+1]=n+1;
for (int j=n-1;j>=1;j--)
if (aa[i-1][j]) R[i][j]=j+1;else R[i][j]=R[i][j+1];
}
for (int d=1;d<=n;d++)
{
for (auto [i,j]:tong[d])
{
if (pos[i][j]!=i-1)
{
R[i][j]=min(R[i][j],R[i-1][j]);
L[i][j]=max(L[i][j],L[i-1][j]);
}
dp[i][j]=dp[i-1][j]+R[i][j]-L[i][j]-1;
if (L[i][j]>0)
{
int len=pos[i][L[i][j]]-pos[i][j];
dp[i][j]=max(dp[i][j],dp[i][L[i][j]]+len*(R[i][j]-L[i][j]-1));
}
if (R[i][j]<=n)
{
int len=pos[i][R[i][j]]-pos[i][j];
dp[i][j]=max(dp[i][j],dp[i][R[i][j]]+len*(R[i][j]-L[i][j]-1));
}
ans=max(ans,dp[i][j]);
}
}
return ans;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 8160kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 0
result:
wrong answer wrong
Subtask #2:
score: 0
Wrong Answer
Test #10:
score: 2
Acceptable Answer
time: 1ms
memory: 7940kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 1 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 0
result:
points 0.250 partial
Test #11:
score: 2
Acceptable Answer
time: 1ms
memory: 7904kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 1 0 0 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 2
result:
points 0.250 partial
Test #12:
score: 2
Acceptable Answer
time: 0ms
memory: 8136kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 0 1 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 3
result:
points 0.250 partial
Test #13:
score: 2
Acceptable Answer
time: 1ms
memory: 10004kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 1 0 0 1 0 1 0 0 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 2
result:
points 0.250 partial
Test #14:
score: 2
Acceptable Answer
time: 1ms
memory: 7884kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 0 1 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 2
result:
points 0.250 partial
Test #15:
score: 0
Wrong Answer
time: 1ms
memory: 8180kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 1 0 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 4
result:
wrong answer wrong
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%