Submission #982712

#TimeUsernameProblemLanguageResultExecution timeMemory
982712alo_54Game (APIO22_game)C++17
Compilation error
0 ms0 KiB
//#include "game.h" #include <bits/stdc++.h> using namespace std; struct Nodo { vector <int> ady; bool special = false; }; vector <Nodo> g; int dfs(int node, int target, bool isSpecial) { //cout<<"call "<<node<<" "<<target<<endl; if (node == target ) { if (isSpecial) { return 1; } return 0; } if (g[node].special) { isSpecial = true; } for (auto i : g[node].ady) { if (dfs(i, target, isSpecial) == 1) { return 1; } } return 0; } void init(int n, int k) { g.resize(n); for (int i = 0; i < n; i++) { g[i].special = false; } for (int i = 0; i < k; i++) { g[i].special = true; if (i != k - 1) { g[i].ady.push_back(i + 1); } } } int add_teleporter(int u, int v) { g[u].ady.push_back(v); int resp = 0; resp = dfs(v, u, false); return resp; } int main() { int n, k, m; cin>>n>>k>>m; init(n, k); while (m--) { int u, v; cin>>u>>v; int resp = add_teleporter(u, v); cout<<resp<<endl; } }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccaCiq72.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc9uEID0.o:game.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status