Submission #960192

# Submission time Handle Problem Language Result Execution time Memory
960192 2024-04-09T20:45:08 Z vjudge1 Game (IOI14_game) C++17
Compilation error
0 ms 0 KB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
 
#define int long long

const int N = 2e3+3;
 
int n;
bitset<N> adj[N], edge[N];
 
void dfs(int x) {
    if (adj[x].count() == 1) {
        int y = 0;
        while (!adj[x][y]) y++;

        adj[x][y] = adj[y][x] = 0;
        edge[x][y] = edge[y][x] = 1;

        dfs(y);
    }
}

void initialize(int nn) {
    n = nn;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) continue;
            adj[i][j] = 1;
        }
    }
}
 
int hasEdge(int u, int v) {
    if (edge[u][v]) return 1;

    adj[u][v] = adj[v][u] = 0;

    dfs(u);
    dfs(v);

    return 0;
}

Compilation message

/usr/bin/ld: /tmp/ccObX8Mq.o: in function `main':
grader.cpp:(.text.startup+0x2a): undefined reference to `initialize(int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x94): undefined reference to `hasEdge(int, int)'
collect2: error: ld returned 1 exit status