QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#343942#8270. Mineral depositshyforces#Compile Error//C++201.5kb2024-03-03 10:10:152024-04-28 08:43:27

Details

answer.code: In function ‘int main()’:
answer.code:41:32: error: no matching function for call to ‘std::vector<int>::push_back(std::pair<int, int>&)’
   41 |                 ncand.push_back(b);
      |                 ~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_vector.h:1278:7: note: candidate: ‘constexpr void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]’
 1278 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:35: note:   no known conversion for argument 1 from ‘std::pair<int, int>’ to ‘const std::vector<int>::value_type&’ {aka ‘const int&’}
 1278 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:1295:7: note: candidate: ‘constexpr void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]’
 1295 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1295:30: note:   no known conversion for argument 1 from ‘std::pair<int, int>’ to ‘std::vector<int>::value_type&&’ {aka ‘int&&’}
 1295 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
answer.code:44:19: error: cannot convert ‘std::vector<int>’ to ‘std::vector<std::pair<int, int> >&’
   44 |         cand.swap(ncand);
      |                   ^~~~~
      |                   |
      |                   std::vector<int>
/usr/include/c++/13/bits/stl_vector.h:1583:20: note:   initializing argument 1 of ‘constexpr void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]’
 1583 |       swap(vector& __x) _GLIBCXX_NOEXCEPT
      |            ~~~~~~~~^~~