Submission #422325

# Submission time Handle Problem Language Result Execution time Memory
422325 2021-06-10T03:10:11 Z timmyfeng Toy Train (IOI17_train) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 5000;

vector<int> to[N], from[N], a;
bool win[N], visited[N];
int degree[N], n, m;

void bfs() {
    queue<int> que;
    for (int i = 0; i < n; ++i) {
        degree[i] = 0;
        if (visited[i]) {
            que.push(i);
        }
    }

    while (!que.empty()) {
        int u = que.front();
        que.pop();
        for (auto c : from[u]) {
            if (!visited[c]) {
                if (a[c] == 1 || ++degree[c] == (int) to[c].size()) {
                    visited[c] = true;
                    que.push(c);
                }
            }
        }
    }
}

Compilation message

/usr/bin/ld: /tmp/ccYwhker.o: in function `main':
grader.cpp:(.text.startup+0x29f): undefined reference to `who_wins(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status