QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#317388 | #7120. Soccer | Random_Code# | 0 | 453ms | 10100kb | C++17 | 1.8kb | 2024-01-28 22:14:25 | 2024-01-28 22:14:25 |
Judging History
answer
//ANMHLIJKTJIY!
#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#include "soccer.h"
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 998244353
#define F first
#define S second
#define ll int
#define N 510
using namespace std;
ll n,a[N][N],f[2][N][N][2],mx[N][N];
int biggest_stadium(int _n,vector<vector<int> > grid)
{
ll i,j,k,ans=0;
n=_n;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
a[i][j]=grid[i][j];
}
}
memset(f[0],-63,sizeof(f[0]));
for(i=0;i<n;i++)
{
ll u=i&1,v=u^1;
for(j=0;j<n;j++)
{
for(k=j;k<n;k++)
{
f[v][j][k][0]=0;
f[v][j][k][1]=0;
}
}
for(j=0;j<n;j++)
{
f[v][j][j][0]=max(f[u][j][j][0],0);
}
for(j=2;j<=n;j++)
{
for(k=0;k+j-1<n;k++)
{
f[v][k][k+j-1][0]=max(f[u][k][k+j-1][0],max(f[v][k][k+j-2][0],f[v][k+1][k+j-1][0]));
}
}
f[v][0][n-1][1]=max(max(f[u][0][n-1][0],f[u][0][n-1][1]),0);
for(j=n-1;j>=1;j--)
{
for(k=0;k+j-1<n;k++)
{
ll val=max(f[u][k][k+j-1][0],f[u][k][k+j-1][1]);
f[v][k][k+j-1][1]=max(val,max((k+j==n?0:f[v][k][k+j][1]),(k==0?0:f[v][k-1][k+j-1][1])));
}
}
for(j=0;j<n;j++)
{
for(k=j;k<n;k++)
{
f[v][j][k][0]+=k-j+1;
f[v][j][k][1]+=k-j+1;
}
}
for(j=0;j<n;j++)
{
bool hv=false;
for(k=j;k<n;k++)
{
if(a[i][k])
{
hv=true;
}
if(hv)
{
f[v][j][k][0]=f[v][j][k][1]=-INF;
}
else
{
ans=max(ans,f[v][j][k][0]);
ans=max(ans,f[v][j][k][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: 6868kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 1
result:
ok ok
Test #2:
score: 6
Accepted
time: 1ms
memory: 7920kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #3:
score: 6
Accepted
time: 3ms
memory: 8464kb
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:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 9850
result:
ok ok
Test #4:
score: 6
Accepted
time: 453ms
memory: 10100kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 500 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:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 236536
result:
ok ok
Test #5:
score: 0
Runtime Error
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 2000 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: 1ms
memory: 8756kb
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: 8420kb
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: 7992kb
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%