답안 #918153

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
918153 2024-01-29T13:18:50 Z Sputnik123 Easter Eggs (info1cup17_eastereggs) C++14
컴파일 오류
0 ms 0 KB
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> e;
vector <int> adj[600];
void dfs(int node,int par)
{
	e.push_back(node);
    for(int i:adj[node])
    {
        if(i==par)  continue;
        dfs(i,node);
    }
}
int findegg(int n,vector<pair<int,int>> bridges)
{
    e.clear();
    for(int i=0;i<=n;i++)
        adj[i].clear();
    for(pair <int,int> p: bridges)
    {
        adj[p.first].push_back(p.second);
        adj[p.second].push_back(p.first);
    }
    dfs(1,1);
    int l=0,r=e.size()-1;
    while (l < r)
    {
        int mid = (l + r) >> 1;
        vector<int> nw;
        for (int i = 0; i <= mid; i++) nw.push_back(e[i]);
        if (query(nw)) r = mid;
        else l = mid + 1;
    }
    return e[l];
}

Compilation message

/usr/bin/ld: /tmp/ccQ1hz6b.o: in function `main':
grader.cpp:(.text.startup+0x1e6): undefined reference to `findEgg(int, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >)'
collect2: error: ld returned 1 exit status