Submission #395055

# Submission time Handle Problem Language Result Execution time Memory
395055 2021-04-27T16:50:56 Z Nicholas_Patrick Sequence (BOI14_sequence) C++17
Compilation error
0 ms 0 KB
#include "coprobber.h"
#include "grader.cpp"
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;

int cop;
bool a[MAX_N][MAX_N];
vector<int> adjLis[MAX_N];
//sub2
int sidelength;
vector<vector<int>> solved, run;
void solve(int cop, int robber, bool copturn=true){
	//calling this function: robber caught
	if(copturn){
		for(int i: adjLis[robber]){
			run[cop][i]--;
			if(run[cop][i]==0)//no place to run
				solve(cop, i, false);
		}
	}else{
		for(int i: adjLis[cop]){
			if(solved[i][robber]==-1){
				solved[i][robber]=cop;
				solve(i, robber, true);
			}
		}
		if(solved[cop][robber]==-1){
			solved[cop][robber]=cop;
			solve(cop, robber, true);
		}
	}
}
int start(int n, bool A[MAX_N][MAX_N]){
	for(int i=n; i--;)for(int j=n; j--;)
		a[i][j]=A[i][j];
	for(int i=n; i--;)for(int j=n; j--;){
		if(a[i][j])
			adjLis[i].push_back(j);
	}
	solved.assign(n, vector<int>(n, -1));
	run.assign(n, vector<int>(n, 0));
	for(int i=n; i--;)for(int j=n; j--;)
		run[i][j]=adjLis[j].size();

	for(int i=n; i--;){
		solved[i][i]=i;
		solve(i, i);
	}
	for(int i=n; i--;)for(int j: adjLis[i]){
		solved[i][j]=j;
		solve(i, j);
	}
	if(*min_element(solved[0].begin(), solved[0].end())>=0)
		return cop=0;
	return -1;
}
int nextMove(int r){
	return cop=solved[cop][r];
}

Compilation message

sequence.cpp:1:10: fatal error: coprobber.h: No such file or directory
    1 | #include "coprobber.h"
      |          ^~~~~~~~~~~~~
compilation terminated.