Submission #349568

# Submission time Handle Problem Language Result Execution time Memory
349568 2021-01-17T20:44:32 Z blue Stations (IOI20_stations) C++17
Compilation error
0 ms 0 KB
#include "stations.h"
#include <vector>
using namespace std;

vector<int> visit(1000, 0);
vector<int> edge[1000];
vector<int> L;

int dfs(int u, int a, bool flag)
{
    visit[u] = 1;

    if(flag == 0)
    {
        L[u] = a;
        a++;
    }

    for(int v: edge[u])
    {
        if(visit[v]) continue;
        a = dfs(v, a, !flag);
    }

    if(flag == 1)
    {
        L[u] = a;
        a++;
    }

    return a;
}

vector<int> label(int n, int k, vector<int> u, vector<int> v)
{
    for(int i = 0; i < n-1; i++)
    {
        edge[u[i]].push_back(v[i]);
        edge[v[i]].push_back(u[i]);
    }

    L = vector<int>(n, -1);

    dfs(0, 0, 0);

    return L;
}

Compilation message

/tmp/ccKIQhsb.o: In function `main':
stub.cpp:(.text.startup+0x4bc): undefined reference to `find_next_station(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status