Submission #918086

#TimeUsernameProblemLanguageResultExecution timeMemory
918086Ferid20072020Easter Eggs (info1cup17_eastereggs)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; int color[513]; vector<vector<int>> g(513); vector<int> List; void DFS(int node){ color[node] = 1; List.pb(node); for(auto to : g[node]){ if(color[to] == 0){ DFS(to); } } } int findEgg (int N, vector < pair < int, int > > bridges) { for(int i=0 ; i<N-1 ; i++){ int u , v; cin >> u >> v; g[u].push_back(v); g[v].push_back(u); } DFS(1); int l = 0 , r = N-1; while(l <= r){ int mid = (l + r) / 2; vector<int> check; for(int i=l ; i<=mid ; i++){ check.push_back(List[i]); } int ans = query(check); if(ans == 1){ r = mid - 1; } else{ l = mid + 1; } } return (l + r) / 2; }

Compilation message (stderr)

eastereggs.cpp: In function 'void DFS(int)':
eastereggs.cpp:12:10: error: 'class std::vector<int>' has no member named 'pb'
   12 |     List.pb(node);
      |          ^~