QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#464232#7516. Robot Experimentucup-team3884#Compile Error//C++201.2kb2024-07-05 22:57:022024-07-05 22:57:02

詳細信息

answer.code: In function ‘void solve()’:
answer.code:53:36: error: no matching function for call to ‘std::vector<std::pair<int, int> >::emplace(int&, int&)’
   53 |                 if (ok) res.emplace(x, y);
      |                         ~~~~~~~~~~~^~~~~~
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:1343:9: note: candidate: ‘template<class ... _Args> constexpr std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::emplace(const_iterator, _Args&& ...) [with _Args = {_Args ...}; _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]’
 1343 |         emplace(const_iterator __position, _Args&&... __args)
      |         ^~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1343:9: note:   template argument deduction/substitution failed:
answer.code:53:37: note:   cannot convert ‘x’ (type ‘int’) to type ‘std::vector<std::pair<int, int> >::const_iterator’
   53 |                 if (ok) res.emplace(x, y);
      |                                     ^