Submission #852774

#TimeUsernameProblemLanguageResultExecution timeMemory
852774drkarlicio2107Cop and Robber (BOI14_coprobber)C++14
Compilation error
0 ms0 KiB
#include "coprobber.h" #include <bits/stdc++.h> using namespace std; int kol [510][510][2]; int st [510][510][2]; queue < pair <int, pair <int, int> > > kju; int mov [510][510]; int curr; int start (int n, bool l [510][510]){ for (int i=0; i<n; i++){ for (int j=0; j<n; j++){ int uk=0; for (int k=0; k<n; k++) uk+=l [j][k]; kol [i][j][0]=1; kol [i][j][1]=uk; if (i==j){ kju.push ({0, {i, j}}); kju.push ({1, {i, j}}); } } } while (!kju.empty()){ int m=kju.front().first; int a=kju.front().second.first; int b=kju.front().second.second; //cout << m << " " << a << " " << b << endl; st [m][a][b]=1; if (m==0){ for (int i=0; i<n; i++){ if (!l [i][b]) continue; kol [a][i][1]--; if (kol [a][i][1]==0){ kju.push ({1, {a, i}}); } } } else { for (int i=0; i<n; i++){ if (!l [i][a]) continue; kol [i][b][0]--; if (kol [i][b][0]==0){ kju.push ({0, {i, b}}); mov [i][b]=a; } } } kju.pop(); } for (int i=0; i<n; i++){ int uk=0; for (int j=0; j<n; j++) uk+=st [1][i][j]; if (uk==n) return curr=i; } return -1; } int nextMove (int x){ return curr=mov [curr][x]; } int a [510][510]; /*int main(){ int n; cin >> n; for (int i=0; i<n; i++){ for (int j=0; j<n; j++) cin >> a [i][j]; } cout << start (n, a) << endl; while (true){ int x; cin >> x; if (x==-1) break; cout << nextMove (x) << endl; } return 0; }*/

Compilation message (stderr)

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