답안 #522175

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
522175 2022-02-04T03:31:08 Z blue Easter Eggs (info1cup17_eastereggs) C++17
컴파일 오류
0 ms 0 KB
#include <vector>
#include <cassert>
#include "grader.h"
using namespace std;

using vi = vector<int>;
using pii = pair<int, int>;

const int mx = 512;

vi edge[1+mx];


vi ord(1, 0);

void dfs(int u, int p)
{
    ord.push_back(u);
    for(int v : edge[u])
    {
        if(v != p) 
            dfs(v, u);
    }
}


int findEgg (int N, vector < pair < int, int > > bridges)
{
    f
    for(pii b: bridges)
    {
        edge[b.first].push_back(b.second);
        edge[b.second].push_back(b.first);
    }

    dfs(1, 0);

    assert(int(bridges.size()) == N-1);
    // assert(int(ord.size()) == N+1);

    // int lo = 1, hi = N;
    // while(lo != hi)
    {
    //     int mid = (lo+hi)/2;

    //     vi qr;
    //     for(int i = 1; i <= mid; i++)
    //         qr.push_back(ord[i]);

    //     if(query(qr))
    //         hi = mid;
    //     else
    //         lo = mid+1;
    }

    // return ord[lo];
}

Compilation message

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:29:5: error: 'f' was not declared in this scope
   29 |     f
      |     ^
eastereggs.cpp:57:1: warning: control reaches end of non-void function [-Wreturn-type]
   57 | }
      | ^