/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:33:41: error: no matching function for call to 'std::vector<std::tuple<long long int, long long int, long long int, long long int> >::push_back(<brace-enclosed initializer list>)'
         rects.push_back({x1, y1, x2, y2});
                                         ^
In file included from /usr/include/c++/6/vector:64:0,
                 from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_vector.h:914:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::tuple<long long int, long long int, long long int, long long int>; _Alloc = std::allocator<std::tuple<long long int, long long int, long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<long long int, long long int, long long int, long long int>]
       push_back(const value_type& __x)
       ^~~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:914:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::tuple<long long int, long long int, long long int, long long int>&}'
/usr/include/c++/6/bits/stl_vector.h:932:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::tuple<long long int, long long int, long long int, long long int>; _Alloc = std::allocator<std::tuple<long long int, long long int, long long int, long long int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<long long int, long long int, long long int, long long int>]
       push_back(value_type&& __x)
       ^~~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:932:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::tuple<long long int, long long int, long long int, long long int> >::value_type&& {aka std::tuple<long long int, long long int, long long int, long long int>&&}'
/in/foo.cc:46:32: error: no matching function for call to 'get(const std::tuple<long long int, long long int, long long int, long long int>&)'
         int x1 = cx[get<0>(rect)], y1 = cy[get<1>(rect)];
                                ^
In file included from /usr/include/c++/6/algorithm:60:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/utility:202:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(std::pair<_Tp1, _Tp2>&)
     get(std::pair<_Tp1, _Tp2>& __in) noexcept
     ^~~
/usr/include/c++/6/utility:202:5: note:   template argument deduction/substitution failed:
/in/foo.cc:46:32: note:   types 'std::pair<_Tp1, _Tp2>' and 'const std::tuple<long long int, long long int, long long int, long long int>' have incompatible cv-qualifiers
         int x1 = cx[get<0>(rect)], y1 = cy[get<1>(rect)];
                                ^
In file included from /usr/include/c++/6/algorithm:60:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/utility:207:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(std::pair<_Tp1, _Tp2>&&)
     get(std::pair<_Tp1, _Tp2>&& __in) noexcept
     ^~~
/usr/include/c++/6/utility:207:5: note:   template argument deduction/substitution failed:
/in/foo.cc:46:32: note:   types 'std::pair<_Tp1, _Tp2>' and 'const std::tuple<long long int, long long int, long long int, long long int>' have incompatible cv-qualifiers
         int x1 = cx[get<0>(rect)], y1 = cy[get<1>(rect)];
                                ^
In file included from /usr/include/c++/6/algorithm:60:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/utility:212:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const std::pair<_Tp1, _Tp2>&)
     get(const std::pair<_Tp1, _Tp2>& __in) noexcept
     ^~~
/usr/include/c++/6/utility:212:5: note:   template argument deduction/substitution failed:
/in/foo.cc:46:32: note:   'const std::tuple<long long int, long long int, long long int, long long int>' is not derived from 'const std::pair<_Tp1, _Tp2>'
         int x1 = cx[get<0>(rect)], y1 = cy[get<1>(rect)];
                                ^
/in/foo.cc:47:32: error: no matching function for call to 'get(const std::tuple<long long int, long long int, long long int, long long int>&)'
         int x2 = cx[get<2>(rect)], y2 = cy[get<3>(rect)];
                                ^
In file included from /usr/include/c++/6/algorithm:60:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/utility:202:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(std::pair<_Tp1, _Tp2>&)
     get(std::pair<_Tp1, _Tp2>& __in) noexcept
     ^~~
/usr/include/c++/6/utility:202:5: note:   template argument deduction/substitution failed:
/in/foo.cc:47:32: note:   types 'std::pair<_Tp1, _Tp2>' and 'const std::tuple<long long int, long long int, long long int, long long int>' have incompatible cv-qualifiers
         int x2 = cx[get<2>(rect)], y2 = cy[get<3>(rect)];
                                ^
In file included from /usr/include/c++/6/algorithm:60:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/utility:207:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(std::pair<_Tp1, _Tp2>&&)
     get(std::pair<_Tp1, _Tp2>&& __in) noexcept
     ^~~
/usr/include/c++/6/utility:207:5: note:   template argument deduction/substitution failed:
/in/foo.cc:47:32: note:   types 'std::pair<_Tp1, _Tp2>' and 'const std::tuple<long long int, long long int, long long int, long long int>' have incompatible cv-qualifiers
         int x2 = cx[get<2>(rect)], y2 = cy[get<3>(rect)];
                                ^
In file included from /usr/include/c++/6/algorithm:60:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/utility:212:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const std::pair<_Tp1, _Tp2>&)
     get(const std::pair<_Tp1, _Tp2>& __in) noexcept
     ^~~
/usr/include/c++/6/utility:212:5: note:   template argument deduction/substitution failed:
/in/foo.cc:47:32: note:   'const std::tuple<long long int, long long int, long long int, long long int>' is not derived from 'const std::pair<_Tp1, _Tp2>'
         int x2 = cx[get<2>(rect)], y2 = cy[get<3>(rect)];
                                ^
/in/foo.cc:48:18: error: 'y1' was not declared in this scope
         diff[x1][y1]++;
                  ^~
/in/foo.cc:49:18: error: 'y2' was not declared in this scope
         diff[x1][y2]--;
                  ^~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator.h: In instantiation of '__gnu_cxx::__normal_iterator<_Iterator, _Container>& __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator++() [with _Iterator = std::tuple<long long int, long long int, long long int, long long int>*; _Container = std::vector<std::tuple<long long int, long long int, long long int, long long int> >]':
/in/foo.cc:45:29:   required from here
/usr/include/c++/6/bits/stl_iterator.h:799:2: error: cannot increment a pointer to incomplete type 'std::tuple<long long int, long long int, long long int, long long int>'
  ++_M_current;
  ^~~~~~~~~~~~
In file included from /usr/include/c++/6/vector:64:0,
                 from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<long long int, long long int, long long int, long long int>; _Alloc = std::allocator<std::tuple<long long int, long long int, long long int, long long int> >]':
/usr/include/c++/6/bits/stl_vector.h:259:15:   required from 'std::vector<_Tp, _Alloc>::vector() [with

信息

递交者
类型
递交
题目
P1056 图形面积
语言
C++
递交时间
2024-07-24 17:31:01
评测时间
2024-07-24 17:31:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes