Submission #841831

#TimeUsernameProblemLanguageResultExecution timeMemory
841831manizareCop and Robber (BOI14_coprobber)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "coprobber.h" #define pb push_back #define F first #define S second #define all(a) a.begin(),a.end() #define pii pair<int,int> #define int long long using namespace std ; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const int maxk=1002 , sq = 333 , lg = 20 , K = 0, inf = 1e18+10 , mod = 1e9 + 7 ; int cnt = 0 , dis[MAX_N] , par[MAX_N] , st[MAX_N] , en[MAX_N] , cur = 0 ; vector <int> G[MAX_N] ; void dfs(int v , int p = -1){ st[v] = cnt ; cnt++; for(int i =0 ; i < (int)G[v].size() ; i++){ int u = G[v][i] ; if(u== p)continue ; dis[u] = dis[v] + 1; dfs(u , v) ; } en[v] = cnt ; cnt ++ ; } int start(int n , bool a[MAX_N][MAX_N]){ for(int i = 0 ; i < n ; i++){ for(int j =0 ; j < n; j++){ if(a[i][j])G[i].pb(j) ; } } dfs(0) ; return 0; } int ch(int v , int u){ if(st[u] >= st[v] && en[v] >= en[u]){ return 1; } return 0 ; } int nextMove(int v){ if(dis[v]-1 == dis[cur])return cur ; for(int i =0 ; i < (int)G[cur].size() ; i++){ int u = G[cur][i] ; if(ch(u, v) && ch(cur , u)){ cur = u; break ; } } return cur ; } /* signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int m ; cin >> n >>m ; for(int i =1;i <= m ; i++){ int v , u ; cin >> v >> u ; c[v][u] = c[u][v] = 1; } int cc = start(n , c) ; cout << cc << endl ;cout.flush(); cout.flush() ; if(cc == -1)return 0; while(1){ int t ; cin >> t; if(t == cc)return 0 ; cc = nextMove(t) ; cout << cc << endl ;cout.flush() ; } } */

Compilation message (stderr)

/usr/bin/ld: /tmp/cct9A7Bx.o: in function `main':
grader.cpp:(.text.startup+0x16c): undefined reference to `start(int, bool (*) [500])'
/usr/bin/ld: grader.cpp:(.text.startup+0x2be): undefined reference to `nextMove(int)'
collect2: error: ld returned 1 exit status