QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#174944#6563. Four SquareMaMengQiCompile Error//C++202.9kb2023-09-10 14:49:512023-09-10 14:49:51

Details

answer.code: In function ‘void poss1(std::vector<int>&, int, int)’:
answer.code:6:19: error: request for member ‘first’ in ‘(& now)->std::vector<int>::operator[](0)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
    6 |         if(now[0].first == w && now[0].second == h) return 1;
      |                   ^~~~~
answer.code:6:40: error: request for member ‘second’ in ‘(& now)->std::vector<int>::operator[](0)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
    6 |         if(now[0].first == w && now[0].second == h) return 1;
      |                                        ^~~~~~
answer.code:6:60: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
    6 |         if(now[0].first == w && now[0].second == h) return 1;
      |                                                            ^
answer.code:7:19: error: request for member ‘second’ in ‘(& now)->std::vector<int>::operator[](0)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
    7 |         if(now[0].second == w && now[0].first == h) return 1;
      |                   ^~~~~~
answer.code:7:41: error: request for member ‘first’ in ‘(& now)->std::vector<int>::operator[](0)’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
    7 |         if(now[0].second == w && now[0].first == h) return 1;
      |                                         ^~~~~
answer.code:7:60: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
    7 |         if(now[0].second == w && now[0].first == h) return 1;
      |                                                            ^
answer.code:8:16: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
    8 |         return 0;
      |                ^
answer.code: In function ‘void poss2(std::vector<int>&, int, int)’:
answer.code:15:39: error: no matching function for call to ‘std::vector<std::pair<int, int> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)’
   15 |                         pass.push_back(now[j]);
      |                         ~~~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/11/vector:67,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, int>]’
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’} to ‘const value_type&’ {aka ‘const std::pair<int, int>&’}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, int>]’
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’} to ‘std::vector<std::pair<int, int> >::value_type&&’ {aka ‘std::pair<int, int>&&’}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
answer.code:17:27: error: request for member ‘first’ in ‘(& now)->std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
   17 |                 if(now[i].first == w) return poss1(pass, w, h - now[i].second);
      |                           ^~~~~
answer.code:17:72: error: request for member ‘second’ in ‘(& now)->std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
   17 |                 if(now[i].first == w) return poss1(pass, w, h - now[i].second);
      |                                                                        ^~~~~~
answer.code:18:27: error: request for member ‘second’ in ‘(& now)->std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<i...