Submission #1096251

# Submission time Handle Problem Language Result Execution time Memory
1096251 2024-10-04T07:00:48 Z vjudge1 Amusement Park (JOI17_amusement_park) C++17
Compilation error
0 ms 0 KB
#include "Ioi.h"
#include <vector>
#include <algorithm>
#include <cassert>

using ll = long long;
const int NMAX = 10'000;

std::vector<int> g[NMAX + 1];
int value[NMAX + 1];
bool vis[NMAX + 1];
int parent[NMAX + 1];

std::vector<int> order;
void dfs(int u) {
  order.push_back(u);
  vis[u] = true;
  for (const auto &v : g[u]) {
    if (!vis[v]) {
      parent[v] = u;
      dfs(v);
    }
  }
}

bool hasSon(int u, int v) { // v e fiu al lui u?
  for (const auto &w : g[u]) {
    if (v == w) {
      return true;
    }
  }
  return false;
}

long long Ioi(int n, int m, int a[], int b[], int P, int V, int T) {
  for (int i = 0; i < m; i++) {
    g[a[i]].push_back(b[i]);
    g[b[i]].push_back(a[i]);
  }
  for (int i = 0; i < n; i++) {
    std::sort(g[i].begin(), g[i].end());
  }
  dfs(0);
  int u = P;
  ll answer = 0;
  if (u == 0) {
    Move(g[0][0]);
    answer = Move(0);
  }
  while (u != 0) {
    u = parent[u];
    answer = Move(u);
  }
  for (int i = 1; i < 60; i++) {
    while (u != 0 && !hasSon(u, order[i])) {
      u = parent[u];
      Move(u);
    }
    assert(hasSon(u, order[i]));
    if (Move(order[i])) {
      answer |= (1LL << i);
    }
    u = order[i];
  }
  return answer;
}



    

Compilation message

Joi.cpp: In function 'long long int Ioi(int, int, int*, int*, int, int, int)':
Joi.cpp:47:5: error: 'Move' was not declared in this scope
   47 |     Move(g[0][0]);
      |     ^~~~
Joi.cpp:52:14: error: 'Move' was not declared in this scope
   52 |     answer = Move(u);
      |              ^~~~
Joi.cpp:57:7: error: 'Move' was not declared in this scope
   57 |       Move(u);
      |       ^~~~
Joi.cpp:60:9: error: 'Move' was not declared in this scope
   60 |     if (Move(order[i])) {
      |         ^~~~

/usr/bin/ld: /tmp/ccpqznp5.o: in function `main':
grader_ioi.cpp:(.text.startup+0x3f2): undefined reference to `Ioi(int, int, int*, int*, int, int, int)'
collect2: error: ld returned 1 exit status