记录详情

Compile Error

foo.cc: In member function 'void solution::input()':
foo.cc:20:37: error: no matching function for call to 'std::vector<params>::push_back(<brace-enclosed initializer list>)'
   20 |     datas.push_back({allDistance, 0});
      |                                     ^
In file included from /usr/include/c++/9/vector:67,
                 from foo.cc:3:
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = params; _Alloc = std::allocator<params>; std::vector<_Tp, _Alloc>::value_type = params]'
 1184 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1184:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const params&'}
 1184 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_vector.h:1200:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = params; _Alloc = std::allocator<params>; std::vector<_Tp, _Alloc>::value_type = params]'
 1200 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1200:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<params>::value_type&&' {aka 'params&&'}
 1200 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1023 旅行家的预算
语言
C++
递交时间
2022-07-22 11:48:25
评测时间
2022-07-22 11:48:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes