Submission #300051

#TimeUsernameProblemLanguageResultExecution timeMemory
300051kevleeGame (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "game.h"
using namespace std;
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
int comp[1505], sz[1505], link[1505][1505];
int n ;
void initialize(int N) {  
  n = N;
  FOR(i, 1, n) comp[i] = i, sz[i] = 1;
  FOR(i, 1, n) {
    FOR(j, 1, n) {
      if (i != j) link[i][j] = 1;
    }
  }
  return;
}
int hasEdge(int u, int v) {
  u++;
  v++;
  if (link[comp[u]][comp[v]] == 1) {
    FOR(i, 1, n) {
      if (comp[i] != comp[v] && comp[i] != comp[u] && comp[i] == i) {
        link[comp[i]][comp[v]] += link[comp[i]][comp[u]];
        link[comp[v]][comp[i]] += link[comp[i]][comp[u]];
      }
    }
    sz[comp[v]] += sz[comp[u]];
    int tmp = comp[u];
    FOR(i, 1, n) {
      if (comp[i] == tmp) comp[i] = comp[v];
    }
    debug();
    return 1;
  }
  link[comp[u]][comp[v]]--;
  link[comp[v]][comp[u]]--;
  debug();
  return 0;
}

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:32:5: error: 'debug' was not declared in this scope
   32 |     debug();
      |     ^~~~~
game.cpp:37:3: error: 'debug' was not declared in this scope
   37 |   debug();
      |   ^~~~~