Submission #398855

# Submission time Handle Problem Language Result Execution time Memory
398855 2021-05-04T21:29:01 Z almothana05 Cop and Robber (BOI14_coprobber) C++14
Compilation error
0 ms 0 KB
#include "coprobber.h"
int menge = 0 , jet = 0;
vector<vector<bool> >num;
int start(int N, bool A[MAX_N][MAX_N])
{
	for(int i =  0 ;i < N ; i++){
		num.push_back(vector<int>());
		for(int  j = 0 ; j < N  ; j++){
			num[i].push_back(A[i][j]);
		}
	}
	menge = N;
    return 0;
}

int nextMove(int R)
{
	if(A[jet][R] == 1){
	    return R;
	    
	}
	else{
		return jet;
	}
}

Compilation message

coprobber.cpp:3:1: error: 'vector' does not name a type
    3 | vector<vector<bool> >num;
      | ^~~~~~
coprobber.cpp: In function 'int start(int, bool (*)[500])':
coprobber.cpp:7:3: error: 'num' was not declared in this scope; did you mean 'enum'?
    7 |   num.push_back(vector<int>());
      |   ^~~
      |   enum
coprobber.cpp:7:17: error: 'vector' was not declared in this scope
    7 |   num.push_back(vector<int>());
      |                 ^~~~~~
coprobber.cpp:7:24: error: expected primary-expression before 'int'
    7 |   num.push_back(vector<int>());
      |                        ^~~
coprobber.cpp: In function 'int nextMove(int)':
coprobber.cpp:18:5: error: 'A' was not declared in this scope
   18 |  if(A[jet][R] == 1){
      |     ^
coprobber.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^