/ AOCode /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:23:15: error: unable to deduce 'auto' from 'dpt.std::deque<std::pair<std::pair<int, int>, int> >::front'
   23 |   auto hd=dpt.front;
      |               ^~~~~
foo.cc:23:15: note:   couldn't deduce template parameter 'auto'
foo.cc:31:48: error: no matching function for call to 'std::deque<std::pair<std::pair<int, int>, int> >::push_front(<brace-enclosed initializer list>)'
   31 |    if(!ds)dpt.push_front({{nx,ny},hd.second+ds});
      |                                                ^
In file included from /usr/include/c++/9/deque:67,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:68,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_deque.h:1532:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_front(const value_type&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; std::deque<_Tp, _Alloc>::value_type = std::pair<std::pair<int, int>, int>]'
 1532 |       push_front(const value_type& __x)
      |       ^~~~~~~~~~
/usr/include/c++/9/bits/stl_deque.h:1532:36: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<std::pair<int, int>, int>&'}
 1532 |       push_front(const value_type& __x)
      |                  ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_deque.h:1547:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_front(std::deque<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; std::deque<_Tp, _Alloc>::value_type = std::pair<std::pair<int, int>, int>]'
 1547 |       push_front(value_type&& __x)
      |       ^~~~~~~~~~
/usr/include/c++/9/bits/stl_deque.h:1547:31: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::deque<std::pair<std::pair<int, int>, int> >::value_type&&' {aka 'std::pair<std::pair<int, int>, int>&&'}
 1547 |       push_front(value_type&& __x)
      |                  ~~~~~~~~~~~~~^~~
foo.cc:32:45: error: no matching function for call to 'std::deque<std::pair<std::pair<int, int>, int> >::push_back(<brace-enclosed initializer list>)'
   32 |    else dpt.push_back({{nx,ny},hd.second+ds});
      |                                             ^
In file included from /usr/include/c++/9/deque:67,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:68,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_deque.h:1569:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; std::deque<_Tp, _Alloc>::value_type = std::pair<std::pair<int, int>, int>]'
 1569 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_deque.h:1569:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<std::pair<int, int>, int>&'}
 1569 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_deque.h:1584:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(std::deque<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; std::deque<_Tp, _Alloc>::value_type = std::pair<std::pair<int, int>, int>]'
 1584 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_deque.h:1584:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::deque<std::pair<std::pair<int, int>, int> >::value_type&&' {aka 'std::pair<std::pair<int, int>, int>&&'}
 1584 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1041 The Maze Tokens
语言
C++
递交时间
2022-04-29 20:15:41
评测时间
2022-04-29 20:15:41
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes