답안 #1109502

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1109502 2024-11-07T00:43:07 Z the_coding_pooh Easter Eggs (info1cup17_eastereggs) C++14
컴파일 오류
0 ms 0 KB
void dfs(vector <int>& vertices, int nd, int rt){
    vertices.push_back(nd);
    for(auto i:graph[nd]){
        if(i != rt)
            dfs(vertices, i, nd);
    }
    return;
}

int findEgg (int N, vector <pair<int, int>> bridges){
    for(auto i:bridges){
        graph[i.fs].push_back(i.sc);
        graph[i.sc].push_back(i.fs);
    }
    vector <int> vertices;
    dfs(vertices, 1, 0);
    int L = 0, R = N - 1, M;
    while(L != R){
        vector <int> tmp = vertices;
        M = (L + R) / 2;
        tmp.erase(tmp.begin() + M + 1, tmp.end());
        if(query(tmp))
            R = M;
        else
            L = M + 1;
    }
    uwu vertices[L];
}

Compilation message

eastereggs.cpp:1:6: error: variable or field 'dfs' declared void
    1 | void dfs(vector <int>& vertices, int nd, int rt){
      |      ^~~
eastereggs.cpp:1:10: error: 'vector' was not declared in this scope
    1 | void dfs(vector <int>& vertices, int nd, int rt){
      |          ^~~~~~
eastereggs.cpp:1:18: error: expected primary-expression before 'int'
    1 | void dfs(vector <int>& vertices, int nd, int rt){
      |                  ^~~
eastereggs.cpp:1:34: error: expected primary-expression before 'int'
    1 | void dfs(vector <int>& vertices, int nd, int rt){
      |                                  ^~~
eastereggs.cpp:1:42: error: expected primary-expression before 'int'
    1 | void dfs(vector <int>& vertices, int nd, int rt){
      |                                          ^~~
eastereggs.cpp:10:21: error: 'vector' has not been declared
   10 | int findEgg (int N, vector <pair<int, int>> bridges){
      |                     ^~~~~~
eastereggs.cpp:10:28: error: expected ',' or '...' before '<' token
   10 | int findEgg (int N, vector <pair<int, int>> bridges){
      |                            ^
eastereggs.cpp: In function 'int findEgg(int, int)':
eastereggs.cpp:11:16: error: 'bridges' was not declared in this scope
   11 |     for(auto i:bridges){
      |                ^~~~~~~
eastereggs.cpp:12:9: error: 'graph' was not declared in this scope
   12 |         graph[i.fs].push_back(i.sc);
      |         ^~~~~
eastereggs.cpp:15:5: error: 'vector' was not declared in this scope
   15 |     vector <int> vertices;
      |     ^~~~~~
eastereggs.cpp:15:13: error: expected primary-expression before 'int'
   15 |     vector <int> vertices;
      |             ^~~
eastereggs.cpp:16:9: error: 'vertices' was not declared in this scope
   16 |     dfs(vertices, 1, 0);
      |         ^~~~~~~~
eastereggs.cpp:16:5: error: 'dfs' was not declared in this scope
   16 |     dfs(vertices, 1, 0);
      |     ^~~
eastereggs.cpp:19:17: error: expected primary-expression before 'int'
   19 |         vector <int> tmp = vertices;
      |                 ^~~
eastereggs.cpp:21:9: error: 'tmp' was not declared in this scope
   21 |         tmp.erase(tmp.begin() + M + 1, tmp.end());
      |         ^~~
eastereggs.cpp:22:12: error: 'query' was not declared in this scope
   22 |         if(query(tmp))
      |            ^~~~~
eastereggs.cpp:27:5: error: 'uwu' was not declared in this scope
   27 |     uwu vertices[L];
      |     ^~~
eastereggs.cpp:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^