QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#155043#7120. SoccerLynkcat0 466ms1005272kbC++202.1kb2023-09-01 07:45:122024-04-28 06:38:23

Judging History

This is the latest submission verdict.

  • [2024-04-28 06:38:23]
  • 管理员手动重测本题所有提交记录
  • Verdict: 0
  • Time: 466ms
  • Memory: 1005272kb
  • [2023-09-01 07:45:12]
  • Judged
  • Verdict: 0
  • Time: 517ms
  • Memory: 1000540kb
  • [2023-09-01 07:45:12]
  • Submitted

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 < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
// #define int ll
#define N 505
using namespace std;
namespace 
{
    int a[N][N],pre[N][N][N];
    int suf[N][N][N];int tmp[N][N];
    int query(int l,int r,int L,int R)
    {
        return a[r][R]-a[l-1][R]-a[r][L-1]+a[l-1][L-1];
    }
}
int biggest_stadium(int n, std::vector<std::vector<int>> aa)
{
    for (int i=0;i<n;i++)
        for (int j=0;j<n;j++)
            a[i+1][j+1]=aa[i][j];
    for (int i=1;i<=n;i++)
        for (int j=1;j<=n;j++)
            a[i][j]+=a[i-1][j]+a[i][j-1]-a[i-1][j-1];
    for (int i=1;i<=n;i++)
        for (int j=i;j<=n;j++)
            pre[1][i][j]=(query(1,1,i,j)==0)*(j-i+1);
    for (int t=2;t<=n;t++)
    {
        for (int i=n;i>=1;i--)
            for (int j=i;j<=n;j++)
                tmp[i][j]=max({pre[t-1][i][j],tmp[i+1][j],tmp[i][j-1]});
        for (int i=1;i<=n;i++)
            for (int j=i;j<=n;j++)
                if (query(t,t,i,j)==0)
                {
                    pre[t][i][j]=tmp[i][j]+j-i+1;
                }
    }
    for (int i=1;i<=n;i++)
        for (int j=i;j<=n;j++)
            suf[n][i][j]=(query(n,n,i,j)==0)*(j-i+1);
    for (int t=n-1;t>=1;t--)
    {
        for (int i=n;i>=1;i--)
            for (int j=i;j<=n;j++)
                tmp[i][j]=max({suf[t+1][i][j],tmp[i+1][j],tmp[i][j-1]});
        for (int i=1;i<=n;i++)
            for (int j=i;j<=n;j++)
                if (query(t,t,i,j)==0)
                {
                    suf[t][i][j]=tmp[i][j]+j-i+1;
                }
    }
    int ans=0;
    for (int t=1;t<=n;t++)
        for (int i=1;i<=n;i++)
            for (int j=i;j<=n;j++)
            if (query(t,t,i,j)==0)
            {
                ans=max(ans,pre[t][i][j]+suf[t][i][j]-(j-i+1));
                // cout<<t<<" "<<i<<" "<<j<<" "<<ans<<" "<<pre[t][i][j]<<" "<<suf[t][i][j]<<endl;
            }
    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: 1ms
memory: 8184kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

score: 6
Accepted
time: 0ms
memory: 14332kb

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

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: 466ms
memory: 1005272kb

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

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

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

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%