Submission #1065313

# Submission time Handle Problem Language Result Execution time Memory
1065313 2024-08-19T06:13:43 Z LittleOrange Soccer Stadium (IOI23_soccer) C++17
Compilation error
0 ms 0 KB
#include "soccer.h"
#include<bits/stdc++.h>
using namespace std;
using ll = int;
struct pos{
    ll x,y;
    bool operator<(const pos &o) const{
        return x!=o.x?x<o.x:y<o.y;
    }
};
struct dsu{
    ll c;
    vector<ll> p;
    dsu(ll N):c(N),p(N,-1){}
    ll g(ll i){
        return p[i]<0?i:p[i] = g(p[i]);
    }
    bool m(ll a, ll b){
        a = g(a),b=g(b);
        if(a==b) return false;
        c--;
        if(p[a]>p[b]) swap(a,b);
        p[a] += p[b];
        p[b] = a;
        return true;
    }
};
int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
    auto &a = F;
    ll n = N;
    if(n<=3){
        ll ret = 0;
        vector<vector<ll>> dis(n*n,vector<ll>(n*n,big));
        for(ll i = 0;i<n;i++){
            for(ll j = 0;j<n-1;j++){
                if (!a[i][j]&&!a[i][j+1]){
                    dis[i*n+j][i*n+(j+1)] = 1;
                }
                if (!a[j][i]&&!a[j+1][i]){
                    dis[j*n+i][(j+1)*n+i] = 1;
                }
            }
        }
        if(n==3){
            for(ll i = 0;i<n;i++){
                if (!a[i][0]&&!a[i][1]&&!a[i][2]){
                    dis[i*n+0][i*n+2] = 1;
                }
                if (!a[0][i]&&!a[1][i]&&!a[2][i]){
                    dis[0*n+i][2*n+i] = 1;
                }
            }
        }
        for(ll i = 0;i<n*n;i++){
            for(ll j = 0;j<n*n;j++){
                for(ll k = 0;k<n*n;k++){
                    dis[i][k] = min(dis[i][k],dis[i][j]+dis[j][k]);
                }
            }
        }
        for(ll x = 0;x<(1<<n*n);x++){
            ll ok = 1;
            for(ll i = 0;i<n*n;i++)if(x>>i&1){
                if (a[i/n][i%n]) ok = 0;
                for(ll j = 0;i<n*n;i++)if(x>>j&1){
                    if (dis[i][j]>2) ok = 0;
                }
            }
            if (ok) ret = max(ret,__builtin_popcountll(x));
        }
        return ret;
    }
    vector<pos> v;
    for(ll i = 0;i<n;i++){
        for(ll j = 0;j<n;j++){
            if (F[i][j]){
                ll v1 = j*n+(n-i-1)*(n-j);
                ll v2 = j*n+i*(n-j);
                ll v3 = (n-j-1)*n+(n-i-1)*(j+1);
                ll v4 = (n-j-1)*n+i*(j+1);
                return max({v1,v2,v3,v4});
            }
        }
    }
    return n*n;
    return 0;
}

Compilation message

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:34:51: error: 'big' was not declared in this scope
   34 |         vector<vector<ll>> dis(n*n,vector<ll>(n*n,big));
      |                                                   ^~~