Submission #398872

#TimeUsernameProblemLanguageResultExecution timeMemory
398872almothana05Cop and Robber (BOI14_coprobber)C++14
Compilation error
0 ms0 KiB
#include "coprobber.h" #include<iostream> #include<vector> using namespace std; int menge = 0 , jet = 0; vector<vector<bool> >num; vector<vector<int> >vis(500+10 , vecto<int>(500 + 10 , 0)); int start(int N, bool A[MAX_N][MAX_N]) { for(int i = 0 ;i < N ; i++){ num.push_back(vector<bool>()); for(int j = 0 ; j < N ; j++){ num[i].push_back(A[i][j]); } } menge = N; return 0; } int nextMove(int R) { if(R == jet){ return jet; } if(num[jet][R] == 1){ return R; } else{ for(int i = 0 ; i < menge ; i++){ if(vis[jet][i] == 0 && num[jet][i] == 1){ vis[i] = 1; return i; } } } }

Compilation message (stderr)

coprobber.cpp:7:34: error: 'vecto' was not declared in this scope
    7 | vector<vector<int> >vis(500+10 , vecto<int>(500 + 10  , 0));
      |                                  ^~~~~
coprobber.cpp:7:40: error: expected primary-expression before 'int'
    7 | vector<vector<int> >vis(500+10 , vecto<int>(500 + 10  , 0));
      |                                        ^~~
coprobber.cpp: In function 'int nextMove(int)':
coprobber.cpp:32:14: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and 'int')
   32 |     vis[i] = 1;
      |              ^
In file included from /usr/include/c++/9/vector:72,
                 from coprobber.cpp:3:
/usr/include/c++/9/bits/vector.tcc:198:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  198 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/vector.tcc:199:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  199 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/9/vector:67,
                 from coprobber.cpp:3:
/usr/include/c++/9/bits/stl_vector.h:706:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  706 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:706:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  706 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_vector.h:727:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  727 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:727:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  727 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
coprobber.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type]
   37 | }
      | ^