QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#317391#7120. SoccerRandom_Code#Compile Error//C++172.2kb2024-01-28 22:22:072024-04-28 08:34:25

Judging History

你现在查看的是最新测评结果

  • [2024-04-28 08:34:25]
  • 管理员手动重测本题所有提交记录
  • [2024-01-28 22:22:08]
  • 评测
  • [2024-01-28 22:22:07]
  • 提交

answer

#include "soccer.h"
#include <cassert>
#include <cstdio>
#include <vector>

int main()
{
    int N;
    assert(1 == scanf("%d", &N));
    std::vector<std::vector<int>> F(N, std::vector<int>(N));
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            assert(1 == scanf("%d", &F[i][j]));
        }
    }
    fclose(stdin);

    int res = biggest_stadium(N, F);

    printf("%d\n", res);
    fclose(stdout);
    return 0;
}
//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 2010
using namespace std;
ll n,a[N][N],mxl[N][N],mxr[N][N],mxu[N][N],mxd[N][N];
ll solve(ll x,ll y)
{
	ll i,j,ret=0;
	for(i=x,j=mxl[x][y];i>mxu[x][y];i--)
	{
		j=max(j,mxl[i][y]);
		ret+=y-j;
	}
	for(i=x,j=mxr[x][y];i>mxu[x][y];i--)
	{
		j=min(j,mxr[i][y]);
		ret+=j-y-1;
	}
	for(i=x+1,j=mxl[x][y];i<mxd[x][y];i++)
	{
		j=max(j,mxl[i][y]);
		ret+=y-j;
	}
	for(i=x+1,j=mxr[x][y];i<mxd[x][y];i++)
	{
		j=min(j,mxr[i][y]);
		ret+=j-y-1;
	}
	return ret;
}
int biggest_stadium(int _n,vector<vector<int> > grid)
{
	ll i,j;
	n=_n;
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			a[i][j]=grid[i][j];
		}
	}
	for(i=0;i<n;i++)
	{
		mxr[i][n]=n;
		for(j=n-1;j>=0;j--)
		{
			mxr[i][j]=(a[i][j]?j:mxr[i][j+1]);
		}
		mxl[i][0]=(a[i][0]?0:-1);
		for(j=1;j<n;j++)
		{
			mxl[i][j]=(a[i][j]?j:mxl[i][j-1]);
		}
	}
	for(i=0;i<n;i++)
	{
		mxd[n][i]=n;
		for(j=n-1;j>=0;j--)
		{
			mxd[j][i]=(a[j][i]?j:mxd[j+1][i]);
		}
		mxu[0][i]=(a[0][i]?0:-1);
		for(j=1;j<n;j++)
		{
			mxu[j][i]=(a[j][i]?j:mxu[j-1][i]);
		}
	}
	ll ans=0;
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			if(!a[i][j])
			{
				ans=max(ans,solve(i,j));
			}
		}
	}
    return ans;
}

Details

answer.code:30:30: warning: ‘-fwhole-program’ is not an option that controls warnings [-Wpragmas]
   30 | #pragma GCC diagnostic error "-fwhole-program"
      |                              ^~~~~~~~~~~~~~~~~
answer.code:31:30: warning: ‘-fcse-skip-blocks’ is not an option that controls warnings [-Wpragmas]
   31 | #pragma GCC diagnostic error "-fcse-skip-blocks"
      |                              ^~~~~~~~~~~~~~~~~~~
answer.code:32:30: warning: ‘-funsafe-loop-optimizations’ is not an option that controls warnings [-Wpragmas]
   32 | #pragma GCC diagnostic error "-funsafe-loop-optimizations"
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cc1UwAOu.o: in function `main':
answer.code:(.text.startup+0x0): multiple definition of `main'; /tmp/cc3PkApw.o:implementer.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status