QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#163888#7120. Soccerzhouhuanyi0 2ms12292kbC++141.3kb2023-09-04 16:08:262023-09-04 16:08:27

Judging History

你现在查看的是测评时间为 2023-09-04 16:08:27 的历史记录

  • [2024-04-28 07:05:10]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:2ms
  • 内存:14068kb
  • [2023-09-04 16:08:27]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:12292kb
  • [2023-09-04 16:08:26]
  • 提交

answer

#include"soccer.h"
#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 3000
using namespace std;
const int inf=(int)(1e9);
int n,ans,R[N+1][N+1],dp[N+1][N+1],ls[N+1],rs[N+1],fa[N+1][N+1],l[N+1][N+1],r[N+1][N+1],dque[N+1],top;
bool used[N+1][N+1];
int calc(int x,int y)
{
	if (R[x][y]==y-1) return -inf;
	if (used[x][y]) return dp[x][y];
	int res=0;
	if (x+1<=n) res=max(res,calc(x+1,y)+r[x][y]-l[x][y]+1);
	if (fa[x][y]) res=max(res,calc(x,fa[x][y]));
	used[x][y]=1,dp[x][y]=res;
	return res;
}
int biggest_stadium(int SN,vector<vector<int>>F)
{
	n=SN;
	for (int i=1;i<=n;++i) R[i][n+1]=n;
	for (int i=1;i<=n;++i)
		for (int j=1;j<=n;++j)
		{
			if (!F[i-1][j-1]) R[i][j]=R[i][j+1];
			else R[i][j]=j-1;
		}
	for (int i=1;i<=n;++i)
	{
		top=0;
		for (int j=1;j<=n;++j) ls[j]=rs[j]=0;
		for (int j=1;j<=n;++j)
		{
		    while (top&&R[i][dque[top]]>=R[i][j]) ls[j]=dque[top],top--;
			if (top) rs[dque[top]]=j;
			l[i][j]=dque[top]+1,dque[++top]=j;
		}
		for (int j=n;j>=1;--j)
		{
			if (ls[j]) fa[i][ls[j]]=j;
			if (rs[j]) fa[i][rs[j]]=j;
			if (rs[j]) r[i][j]=r[i][rs[j]];
			else r[i][j]=j;
		}
	}
	for (int i=1;i<=n;++i)
		for (int j=1;j<=n;++j)
			if (r[i][j]!=j-1)
				ans=max(ans,calc(i,j));
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 9940kb

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

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 1 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

points 0.250 partial

Test #11:

score: 2
Acceptable Answer
time: 1ms
memory: 12008kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 1
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
0

result:

points 0.250 partial

Test #12:

score: 2
Acceptable Answer
time: 2ms
memory: 12004kb

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: 12268kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
1 0 0
1 0 1
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
6

result:

points 0.250 partial

Test #14:

score: 8
Accepted
time: 1ms
memory: 12292kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 0
1 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
6

result:

ok ok

Test #15:

score: 0
Wrong Answer
time: 0ms
memory: 12232kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 1
0 0 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%