Submission #82515

# Submission time Handle Problem Language Result Execution time Memory
82515 2018-10-31T09:00:34 Z farukkastamonuda Werewolf (IOI18_werewolf) C++14
Compilation error
0 ms 0 KB
#include "werewolf.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define lo long long 
#define inf 1000000009
#define md 1000000007
#define li 200005
#define mp make_pair
#define pb push_back
#define mid (start+end)/2
using namespace std;
int vis[li][2];
queue< pair<int,int> > q;
vector<int> v[li],ans;
vector<int> chechk_validity(int N,vector<int> X,vector<int> Y,vector<int> S,vector<int> E,vector<int> L,vector<int> R){
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++) v[j].clear();
		memset(vis,0,sizeof(vis));
		for(int j=0;j<(int)X.size();j++){
			v[X[j]].pb(Y[j]);
			v[Y[j]].pb(X[j]);
		}
		if(S[i]<L[i]) {ans.pb(0);continue;}
		if(S[i]>=L[i] && S[i]<=R[i]) q.push(mp(S[i],1));
		q.push(mp(S[i],0));
		int flag=0;
		while(!q.empty()){
			pair<int,int> temp=q.front();
			q.pop();
			int seh=temp.fi;
			int tur=temp.se;
			if(tur==0 && seh<L[i]) continue;
			if(tur==1 && seh>R[i]) continue;
			if(vis[seh][tur]==1) continue;
			if(seh==E[i] && tur==1){
				flag=1;
				break;
			}
			vis[seh][tur]=1;
			for(int j=0;j<(int)v[seh].size();j++){
				int go=v[seh][j];
				if(go>=L[i] && go<=R[i]) q.push(mp(go,1));
				q.push(mp(go,tur));
			}
		}
		if(flag==1) ans.pb(1);
		else ans.pb(0);
	}
	return ans;
}
//int main(){
	
//	return 0;
//}

Compilation message

/tmp/ccDmZ7Kt.o: In function `main':
grader.cpp:(.text.startup+0x25e): undefined reference to `check_validity(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status