Submission #252542

#TimeUsernameProblemLanguageResultExecution timeMemory
252542fivefourthreeoneCop and Robber (BOI14_coprobber)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define owo(i,a, b) for(int i=(a);i<(b); ++i) #define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i) #define senpai push_back #define ttgl pair<int, int> #define ayaya cout<<"ayaya~"<<endl using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; gp_hash_table<int, int> mp;*/ using ll = long long; using ld = long double; const ll MOD = 1000000007; int gcd(int a,int b){return b?gcd(b,a%b):a;} ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;} ll modInv(ll a){return binpow(a, MOD-2);} const double PI = acos(-1); const double eps = -1e6; const int INF = 0x3f3f3f3f; const int NINF = 0xc0c0c0c0; const ll INFLL = 0x3f3f3f3f3f3f3f3f; const ll NINFLL = 0xc0c0c0c0c0c0c0c0; const int mxN = 501; int st = -1; int adj[mxN][mxN]; int cnt[mxN]; int num[mxN][mxN]; bool flag[mxN][mxN]; bool state[mxN][mxN][2]; //state = [cop_pos, robber_pos] //0 is cop's turn //1 is robber's turn int n; int start(int N, vector<vector<bool>> A) { n= N; queue<array<int, 3>> Q; owo(i, 0, n) { owo(j, 0, n) { adj[i][j] = A[i][j]; cnt[i]+=adj[i][j]; } state[i][i][0] = true; state[i][i][1] = true; Q.push({i, i, 0}); Q.push({i, i, 1}); } while(!Q.empty()) { auto p = Q.front(); if(p[2]==0) { owo(i, 0, n) { if(adj[p[1]][i]) { if(state[p[0]][i][1])continue; num[p[0]][i]++; if(num[p[0]][i]==cnt[i]) { state[p[0]][i][1] = true; Q.push({p[0], i, 1}); } } } }else { owo(i, 0, n) { if(adj[p[0]][i]) { if(state[i][p[1]][0])continue; state[i][p[1]][0] = true; Q.push({i, p[1], 0}); } } } } owo(i, 0, n) { owo(j, 0, n) { if(!state[i][j][0])break; if(j==n-1)st = i; } } return st; } int nextmove(int rpos) { owo(i, 0, n) { if(adj[st][i]&&state[rpos][i][1]&&!flag[rpos][i]) { flag[rpos][i] = true; return st=i; } } } /*int main() { //freopen("file.in", "r", stdin); //freopen("file.out", "w", stdout); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); cin.tie(0)->sync_with_stdio(0); return 0; }*/

Compilation message (stderr)

coprobber.cpp: In function 'int nextmove(int)':
coprobber.cpp:86:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/tmp/ccnyLtUs.o: In function `main':
grader.cpp:(.text.startup+0x13c): undefined reference to `start(int, bool (*) [500])'
grader.cpp:(.text.startup+0x1f8): undefined reference to `nextMove(int)'
collect2: error: ld returned 1 exit status