Submission #249454

# Submission time Handle Problem Language Result Execution time Memory
249454 2020-07-15T04:56:37 Z dantoh000 Meetings (JOI19_meetings) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
void solve(vector<int> v){
    /*printf("solving ");
    for (auto x : v) printf("%d ",x);
    printf("\n");*/
    if (v.size() == 1) return;
    if (v.size() == 2){
        if (v[0] > v[1]) swap(v[0],v[1]);
        Bridge(v[0],v[1]);
        return;
    }
    int p = v[0], q = v[1];
    //printf("cur %d, root %d\n",cur,root);
    for (auto x : v){
        if (x == p || x == q) continue;
        int Q = Query(p,q,x);
        if (Q != p) q = Q;
    }
    //printf("cur %d, root %d\n",cur,root);
    if (p > q) swap(p,q);
    Bridge(p,q);
    vector<int> L, R;
    for (auto x : v){
        if (x == q || x == p) continue;
        int Q = Query(p,q,x);
        assert(Q == p || Q == q);
        if (Q == p) R.push_back(x);
        else L.push_back(x);
    }
    L.push_back(q);
    R.push_back(p);
    solve(L);
    solve(R);
}
void Solve(int N) {
    vector<int> cur;
    for (int i = 0; i < N; i++) cur.push_back(i);
    solve(cur);
}

Compilation message

meetings.cpp: In function 'void solve(std::vector<int>)':
meetings.cpp:10:9: error: 'Bridge' was not declared in this scope
         Bridge(v[0],v[1]);
         ^~~~~~
meetings.cpp:10:9: note: suggested alternative: 'fwide'
         Bridge(v[0],v[1]);
         ^~~~~~
         fwide
meetings.cpp:17:17: error: 'Query' was not declared in this scope
         int Q = Query(p,q,x);
                 ^~~~~
meetings.cpp:22:5: error: 'Bridge' was not declared in this scope
     Bridge(p,q);
     ^~~~~~
meetings.cpp:22:5: note: suggested alternative: 'fwide'
     Bridge(p,q);
     ^~~~~~
     fwide
meetings.cpp:26:17: error: 'Query' was not declared in this scope
         int Q = Query(p,q,x);
                 ^~~~~