QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#317383#7120. SoccerRandom_Code#0 956ms15248kbC++172.7kb2024-01-28 22:02:492024-01-28 22:02:50

Judging History

你现在查看的是测评时间为 2024-01-28 22:02:50 的历史记录

  • [2024-04-28 08:34:16]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:923ms
  • 内存:15464kb
  • [2024-01-28 22:02:50]
  • 评测
  • 测评结果:0
  • 用时:956ms
  • 内存:15248kb
  • [2024-01-28 22:02:49]
  • 提交

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][2],mx[N][N];
int biggest_stadium(int _n,vector<vector<int> > grid)
{
	ll i,j,k,l,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]=0;
				f[v][j][k][0][1]=0;
				f[v][j][k][1][0]=0;
				f[v][j][k][1][1]=0;
			}
		}
		for(j=0;j<n;j++)
		{
			f[v][j][j][0][0]=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][0]=max(f[u][k][k+j-1][0][0],max(f[v][k][k+j-2][0][0],f[v][k+1][k+j-1][0][0]));
			}
		}
		for(j=0;j<n;j++)
		{
			mx[j][n]=0;
			for(k=n-1;k>=j;k--)
			{
				mx[j][k]=max(mx[j][k+1],max(f[u][j][k][0][0],f[u][j][k][0][1]));
			}
		}
		for(j=0;j<n;j++)
		{
			ll cur=0;
			for(k=j;k>=0&&(!a[i][k]);k--)
			{
				cur=max(cur,mx[k][j]);
				f[v][k][j][0][1]=cur;
			}
		}
		for(j=0;j<n;j++)
		{
			mx[j][0]=f[u][0][j][0][0];
			for(k=1;k<=j;k++)
			{
				mx[j][k]=max(mx[j][k-1],max(f[u][k][j][0][0],f[u][k][j][1][0]));
			}
		}
		for(j=0;j<n;j++)
		{
			ll cur=0;
			for(k=j;k<n&&(!a[i][k]);k++)
			{
				cur=max(cur,mx[k][j]);
				f[v][j][k][1][0]=cur;
			}
		}
		f[v][0][n-1][1][1]=max(max(f[u][0][n-1][0][0],f[u][0][n-1][0][1]),max(f[u][0][n-1][1][0],f[u][0][n-1][1][1]));
		for(j=n-1;j>=1;j--)
		{
			for(k=0;k+j-1<n;k++)
			{
				ll val=max(max(f[u][k][k+j-1][0][0],f[u][k][k+j-1][0][1]),max(f[u][k][k+j-1][1][0],f[u][k][k+j-1][1][1]));
				f[v][k][k+j-1][1][1]=max(val,max((k+j==n?0:f[v][k][k+j][1][1]),(k==0?0:f[v][k-1][k+j-1][1][1])));
			}
		}
		for(j=0;j<n;j++)
		{
			for(k=j;k<n;k++)
			{
				f[v][j][k][0][0]+=k-j+1;
				f[v][j][k][0][1]+=k-j+1;
				f[v][j][k][1][0]+=k-j+1;
				f[v][j][k][1][1]+=k-j+1;
			}
		}
		for(j=k=0;j<n;j++)
		{
			while(k<n&&(!a[i][k]))
			{
				k++;
			}
			for(l=k;l<n;l++)
			{
				f[v][j][l][0][0]=f[v][j][l][1][1]=-INF;
			}
		}
		for(j=0;j<n;j++)
		{
			for(k=j;k<n;k++)
			{
				ans=max(ans,f[v][j][k][0][0]);
				ans=max(ans,f[v][j][k][0][1]);
				ans=max(ans,f[v][j][k][1][0]);
				ans=max(ans,f[v][j][k][1][1]);
			}
		}
	}
    return ans;
}

详细

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 6
Accepted
time: 2ms
memory: 10428kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

score: 1.5
Acceptable Answer
time: 0ms
memory: 10328kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
6

result:

points 0.250 partial

Test #3:

score: 1.5
Acceptable Answer
time: 4ms
memory: 12428kb

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
9847

result:

points 0.250 partial

Test #4:

score: 1.5
Acceptable Answer
time: 956ms
memory: 15248kb

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
236104

result:

points 0.250 partial

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: 0ms
memory: 10780kb

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: 2ms
memory: 10488kb

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: 2ms
memory: 10528kb

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%