Submission #145752

#TimeUsernameProblemLanguageResultExecution timeMemory
145752letrongdatCop and Robber (BOI14_coprobber)C++17
Compilation error
0 ms0 KiB
#include "coprobber.h" #include <bits/stdc++.h> const int maxN = 510; using namespace std; #define forn(i, a, b) for(int i=a; i<=b; ++i) #define repn(i, a, b) for(int i=a; i <b; ++i) int cur; int mov[maxN][maxN], deg[maxN][maxN]; int W[maxN][maxN][2]; int start(int N, bool A[maxN][maxN]) { queue < tuple < int, int, int > > q; repn(i, 0, N) repn(j, 0, N) repn(k, 0, N) deg[i][j] += A[j][k]; repn(i, 0, N) forn(turn, 0, 1) { W[i][i][turn] = 1; q.push({i, i, turn}); } while (q.size()) { int c, r, t; tie(c, r, t) = q.front(); q.pop(); repn(i, 0, N) { if (t) { if (A[c][i] || i == c && !W[i][r][0]) { mov[i][r] = c; W[i][r][0] = true; q.push({i, r, 0}); } continue; } if (A[r][i] && !W[c][i][1] && --deg[c][i] < 1) { W[c][i][1] = true; q.push({c, i, 1}); } } } bool ok = true; repn(i, 0, N) ok &= W[0][i][0]; return (ok ? 0 : -1); } int nextMove(int R) { return cur = mov[cur][R]; }

Compilation message (stderr)

coprobber.cpp: In function 'int start(int, bool (*)[510])':
coprobber.cpp:24:39: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                 if (A[c][i] || i == c && !W[i][r][0]) {
                                ~~~~~~~^~~~~~~~~~~~~~
/tmp/ccORmuL2.o: In function `main':
grader.cpp:(.text.startup+0x13c): undefined reference to `start(int, bool (*) [500])'
collect2: error: ld returned 1 exit status