제출 #1347263

#제출 시각아이디문제언어결과실행 시간메모리
1347263hridoyCats or Dogs (JOI18_catdog)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int n;
vector<int> adj[100005];
int state[100005]; 

int danger;

pair<bool,bool> dfs(int node, int parent) {
    bool hasCat = (state[node] == 1);
    bool hasDog = (state[node] == 2);

    for (int next : adj[node]) {
        if (next != parent) {
            auto [childCat, childDog] = dfs(next, node);
            
           
            
            hasCat |= childCat;
            hasDog |= childDog;
        }
    }
    return {hasCat, hasDog};
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccAPhhwq.o: in function `main':
grader.cpp:(.text.startup+0x1d4): undefined reference to `initialize(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: grader.cpp:(.text.startup+0x211): undefined reference to `neighbor(int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x250): undefined reference to `dog(int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x261): undefined reference to `cat(int)'
collect2: error: ld returned 1 exit status