QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#155435 | #7120. Soccer | zhouhuanyi# | 0 | 0ms | 4040kb | C++14 | 1.9kb | 2023-09-01 17:00:02 | 2024-04-28 06:42:23 |
Judging History
answer
#include"soccer.h"
#include<iostream>
#include<cstdio>
#define N 30
using namespace std;
const int inf=(int)(1e9);
int n,DP[N+1][N+1][2][2],dp[N+1][N+1][N+1][2][2];
int biggest_stadium(int SN,vector<vector<int>>F)
{
bool op;
int ans=0;
n=SN;
for (int i=1;i<=n;++i)
{
for (int j=1;j<=n;++j)
for (int k=j;k<=n;++k)
for (int op=0;op<=1;++op)
for (int op2=0;op2<=1;++op2)
dp[i][j][k][op][op2]=-inf;
if (i!=1)
{
for (int j=1;j<=n;++j)
for (int k=j;k<=n;++k)
for (int op=0;op<=1;++op)
for (int op2=0;op2<=1;++op2)
DP[j][k][op][op2]=-inf;
for (int j=1;j<=n;++j)
for (int k=j;k<=n;++k)
for (int op=0;op<=1;++op)
for (int op2=0;op2<=1;++op2)
for (int opt=op;opt<=1;++opt)
for (int opt2=op2;opt2<=1;++opt2)
DP[j][k][opt][opt2]=max(DP[j][k][opt][opt2],dp[i-1][j][k][op][op2]);
for (int j=1;j<=n;++j)
for (int k=n;k>=j;--k)
for (int op=0;op<=1;++op)
for (int op2=0;op2<=1;++op2)
{
if (k+1<=n&&op2) DP[j][k][op][op2]=max(DP[j][k][op][op2],DP[j][k+1][op][op2]);
if (j-1>=1&&op) DP[j][k][op][op2]=max(DP[j][k][op][op2],DP[j-1][k][op][op2]);
}
for (int j=n;j>=1;--j)
for (int k=j+1;k<=n;++k)
for (int op=0;op<=1;++op)
for (int op2=0;op2<=1;++op2)
{
if (!op2) DP[j][k][op][op2]=max(DP[j][k][op][op2],DP[j][k-1][op][op2]);
if (!op) DP[j][k][op][op2]=max(DP[j][k][op][op2],DP[j+1][k][op][op2]);
}
}
for (int j=1;j<=n;++j)
{
op=1;
for (int k=j;k<=n;++k)
{
op&=(!F[i-1][k-1]);
if (op)
{
for (int op=0;op<=1;++op)
for (int op2=0;op2<=1;++op2)
dp[i][j][k][op][op2]=DP[j][k][op][op2]+k-j+1,ans=max(ans,dp[i][j][k][op][op2]);
dp[i][j][k][0][0]=max(dp[i][j][k][0][0],k-j+1),ans=max(ans,k-j+1);
}
}
}
}
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 6
Accepted
time: 0ms
memory: 4024kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 1
result:
ok ok
Test #2:
score: 6
Accepted
time: 0ms
memory: 3796kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #3:
score: 0
Runtime Error
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
result:
Subtask #2:
score: 0
Wrong Answer
Test #10:
score: 8
Accepted
time: 0ms
memory: 4040kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 1 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #11:
score: 8
Accepted
time: 0ms
memory: 3752kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 1 0 0 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #12:
score: 0
Wrong Answer
time: 0ms
memory: 3820kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 0 1 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 6
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%