제출 #398855

#제출 시각아이디문제언어결과실행 시간메모리
398855almothana05경찰관과 강도 (BOI14_coprobber)C++14
컴파일 에러
0 ms0 KiB
#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; } }

컴파일 시 표준 에러 (stderr) 메시지

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 | }
      | ^