Submission #34251

# Submission time Handle Problem Language Result Execution time Memory
34251 2017-11-08T19:35:18 Z imaxblue Cop and Robber (BOI14_coprobber) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int, int>
#define p3i pair<pii, int>
#define pll pair<ll, ll>
#define p3l pair<pll, ll>
#define lseg L, (L+R)/2, N*2+1
#define rseg (L+R)/2+1, R, N*2+2
#define ub upper_bound
#define lb lower_bound
#define pq priority_queue
#define MN 1000000007
#define fox(k, x) for (int k=0; k<x; ++k)
#define fox1(k, x) for (int k=1; k<=x; ++k)
#define foxr(k, x) for (int k=x-1; k>=0; --k)
#define fox1r(k, x) for (int k=x; k>0; --k)
#define ms multiset
#define flood(x) memset(x, 0x3f3f3f3f, sizeof x)
#define drain(x) memset(x, 0, sizeof x)
#define rng() (rand() >> 3)*rand()

int n, m, dp[505][505][2], nxt[505][505];
bool u[505][505][2];
vector<int> v[505];
void dfs(int N, int M, bool B){
	if (u[N][M][B]) return;
	u[N][M][B]=1;
	if (N==M){
		dp[N][M][B]=1;
		return;
	}
	if (B){
		fox(l, v[N].size()){
			dfs(v[N][l], M, !B);
			dp[N][M][B]|=dp[v[N][l]][M][!B];
			if (dp[v[N][l]][M]!=0) nxt[N][M]=v[N][l];
		}
	} else {
		int t=1;
		fox(l, v[M].size()){
			dfs(N, v[M][l], !B);
			t&=dp[N][v[M][l]][!B];
		}
		dp[N][M][B]=0;
	}
}
int start (int N, vector<vector<int> > A){
	fox(l, N){
		v[l]=A[l];
	}
	fox(l, N){
		bool f=1;
		fox(l2, N){
			dfs(l, l2, 0);
			if (dp[l][l2][0]==0){
				f=0;
				break;
			}
		}
		if (f){
			return N;
		}
	}
	return -1;
}
int nextMove(int R){
	m=R;
	n=nxt[n][m];
	return n;
}
int main() {
	
	
	return 0;
}

Compilation message

coprobber.cpp: In function 'void dfs(int, int, bool)':
coprobber.cpp:18:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define fox(k, x) for (int k=0; k<x; ++k)
coprobber.cpp:38:7:
   fox(l, v[N].size()){
       ~~~~~~~~~~~~~~              
coprobber.cpp:38:3: note: in expansion of macro 'fox'
   fox(l, v[N].size()){
   ^~~
coprobber.cpp:18:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define fox(k, x) for (int k=0; k<x; ++k)
coprobber.cpp:45:7:
   fox(l, v[M].size()){
       ~~~~~~~~~~~~~~              
coprobber.cpp:45:3: note: in expansion of macro 'fox'
   fox(l, v[M].size()){
   ^~~
/tmp/ccQh5ehY.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc3dIdVY.o:coprobber.cpp:(.text.startup+0x0): first defined here
/tmp/ccQh5ehY.o: In function `main':
grader.cpp:(.text.startup+0x13c): undefined reference to `start(int, bool (*) [500])'
collect2: error: ld returned 1 exit status