Submission #1186456

#TimeUsernameProblemLanguageResultExecution timeMemory
1186456MighilonMagic Show (APIO24_show)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
 
#ifdef DEBUG
#include "../Library/debug.h"
#else
#include "Alice.h"
#define dbg(x...)
#endif

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl; 
 
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) for (int i = 0; i < (a); ++i)
#define FORd(i, a, b) for (int i = (b) - 1; i >= (a); --i)
#define F0Rd(i, a) for (int i = (a) - 1; i >= 0; --i)
#define trav(a, x) for (auto& a : x)
#define f first 
#define s second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
 
const char nl = '\n';
const int INF = 1e9;
const ll MOD = 998244353;
const int mxN = 3e5+5;

struct DSU {
    vector<int> par, sz;
    int c;
    DSU(int n) : par(n), c(n) {
        sz.resize(n, 1); 
        for (int i = 0; i < n; ++i) par[i] = i;
    }
    int find(int i) {
        return par[i] == i ? i : (par[i] = find(par[i]));
    }
    bool same(int i, int j) {
        return find(i) == find(j);
    }
    int get_size(int i) {
        return sz[find(i)];
    }
    int count() {
        return c;
    }
    int merge(int i, int j) {
        if ((i = find(i)) == (j = find(j))) return -1;
        else --c;
        if (sz[i] > sz[j]) swap(i, j);
        par[i] = j;
        sz[j] += sz[i];
        return j;
    }
};

DSU dsu(5000);
vpi Alice(){
    int n=4923;
    ll x=setN(n);
    vpi e;
    F0R(i,60){
        if((x>>(i+1LL))&1){
            F0R(j,82){
                e.pb({j*60+i+1,(j+1)*60+i+2});
            }
        }
    }
    trav(i,e)
        dsu.merge(i.f-1,i.s-1);
    F0R(i,n-1){
        if(!dsu.same(n-1,i)){
            dsu.merge(n-1,i);
            e.push_back({n-1,i});
        }
    }
    assert(sz(e)==n-1):
    return e;
}

#ifdef DEBUG
int32_t main(){
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    // auto a=Alice();
    // dbg(Bob(a));
}
#endif
#include <bits/stdc++.h>
using namespace std;
 
#ifdef DEBUG
#include "../Library/debug.h"
#else
#include "Bob.h"
#define dbg(x...)
#endif

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl; 
 
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) for (int i = 0; i < (a); ++i)
#define FORd(i, a, b) for (int i = (b) - 1; i >= (a); --i)
#define F0Rd(i, a) for (int i = (a) - 1; i >= 0; --i)
#define trav(a, x) for (auto& a : x)
#define f first 
#define s second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
 
const char nl = '\n';
const int INF = 1e9;
const ll MOD = 998244353;
const int mxN = 3e5+5;


ll Bob(vpi e){
    set<pi> st;
    st.insert(all(e));
    ll res=0;
    F0R(i,60){
        F0R(j,83){
            if(st.find({j*60+i+1,(j+1)*60+i+2})!=st.end()){
                res+=(1LL<<(i+1));
                break;
            }
        }
    }
    return res;
}
#ifdef DEBUG
int32_t main(){
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
}
#endif

Compilation message (stderr)

# 1번째 컴파일 단계

Alice.cpp: In function 'vpi Alice()':
Alice.cpp:86:23: error: expected ';' before ':' token
   86 |     assert(sz(e)==n-1):
      |                       ^
Alice.cpp:88:1: warning: control reaches end of non-void function [-Wreturn-type]
   88 | }
      | ^