답안 #983022

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
983022 2024-05-15T07:07:51 Z Muhammad_Aneeq 화성 (APIO22_mars) C++17
컴파일 오류
0 ms 0 KB
// #include "game.h"
#include <vector>
#include <set>
using namespace std;
int N,K;
int const MAXN=300000+10;
set<int>nei[MAXN]={};
bool vis[MAXN]={};
void init(int n, int k) 
{
  N=n,K=k;
  for (int i=0;i<k-1;i++)
    nei[i].insert(i+1);
}
bool check_cycle(int n)
{
  vis[n]=1;
  for (auto i:nei[n])
  {
    if (vis[i]&&i<K)
      return 1;
    if (vis[i])
      continue;
    if (check_cycle(i))
      return 1;
  }
  vis[n]=0;
  return 0;
}
int add_teleporter(int u, int v) 
{
  nei[u].insert(v);
  for (int i=0;i<N;i++)
  {
    if (check_cycle(i)) return 1;
  }
  return 0;
}

Compilation message

/usr/bin/ld: /tmp/cc3qNygT.o: in function `main':
stub.cpp:(.text.startup+0x793): undefined reference to `process(std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, int, int, int, int)'
collect2: error: ld returned 1 exit status