QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#155730#7118. Closing Timebulijiojiodibuliduo#Compile Error//C++171.8kb2023-09-02 02:58:332024-04-28 06:47:28

Judging History

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

  • [2024-04-28 06:47:28]
  • 管理员手动重测本题所有提交记录
  • [2023-09-02 02:58:34]
  • 评测
  • [2023-09-02 02:58:33]
  • 提交

answer

#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef basic_string<int> BI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int bf(int N, std::vector<std::vector<int>> F) {
    rep(i,0,N) {
        int pl=N+1,pr=-1;
        rep(j,0,N) {
            if (F[i][j]==0) pl=min(pl,j),pr=max(pr,j);
        }
        if (pl<=pr) {
            rep(j,pl,pr+1) if (F[i][j]==1) { return 0; }
        }
    }
    rep(j,0,N) {
        int pl=N+1,pr=-1;
        rep(i,0,N) {
            if (F[i][j]==0) pl=min(pl,i),pr=max(pr,i);
        }
        if (pl<=pr) {
            rep(i,pl,pr+1) if (F[i][j]==1) { return 0; }
        }
    }
    vector<int> f(N*N,0);
    iota(all(f),0);
    function<int(int)> find=[&](int x) {
        return f[x]==x?x:f[x]=find(f[x]);
    };
    int pc=0,r=0;
    rep(i,0,N) rep(j,0,N) {
        if (F[i][j]==0) pc=i*N+j,++r;
        if (j+1<N&&F[i][j]==0&&F[i][j+1]==0) f[find(i*N+j)]=find(i*N+(j+1));
        if (i+1<N&&F[i][j]==0&&F[i+1][j]==0) f[find(i*N+j)]=find((i+1)*N+j);
    }
    rep(i,0,N) rep(j,0,N) if (F[i][j]==0&&find(i*N+j)!=find(pc)) return 0;
    return r;
}

int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
    return bf(N,F);
}

详细

answer.code:1:10: fatal error: soccer.h: No such file or directory
    1 | #include "soccer.h"
      |          ^~~~~~~~~~
compilation terminated.