Submission #579120

#TimeUsernameProblemLanguageResultExecution timeMemory
579120Jarif_RahmanEaster Eggs (info1cup17_eastereggs)C++17
Compilation error
0 ms0 KiB
#include "grader.cpp" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; int findEgg(int n, vector<pair<int, int>> bridges){ vector<vector<int>> v(n); for(auto [a, b]: bridges) a--, b--, v[a].pb(b), v[b-1].pb(a); vector<int> dfs_array; function<void(int, int)> dfs = [&](int nd, int ss){ dfs_array.pb(nd+1); for(int x: v[nd]) if(x != ss) dfs(x, nd); }; dfs(0, -1); int a = 0, b = n-1; while(a < b){ int md = (a+b)/2; if(query(vector<int>(dfs_array.begin(), dfs_array.begin()+md+1))) b = md; else a = md+1; } return dfs_array[a]; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccZTLwcG.o: in function `query(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x0): multiple definition of `query(std::vector<int, std::allocator<int> >)'; /tmp/cc03Mz0D.o:eastereggs.cpp:(.text+0xa0): first defined here
/usr/bin/ld: /tmp/ccZTLwcG.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc03Mz0D.o:eastereggs.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status