/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:17:29: error: no matching function for call to 'std::vector<int>::push_back(std::pair<int, int>&)'
       G[a[i][j]].push_back(z);
                             ^
In file included from /usr/include/c++/6/vector:64:0,
                 from /usr/include/c++/6/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:86,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_vector.h:914:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = 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 'std::pair<int, int>' to 'const value_type& {aka const 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 = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]
       push_back(value_type&& __x)
       ^~~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:932:7: note:   no known conversion for argument 1 from 'std::pair<int, int>' to 'std::vector<int>::value_type&& {aka int&&}'
/in/foo.cc:21:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<G[i].size();j++){
               ~^~~~~~~~~~~~
/in/foo.cc:22:20: error: request for member 'first' in 'G[i].std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}'
    int x = G[i][j].first;
                    ^~~~~
/in/foo.cc:23:20: error: request for member 'second' in 'G[i].std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}'
    int y = G[i][j].second;
                    ^~~~~~

信息

递交者
类型
递交
题目
P1011 清帝之惑之顺治
语言
C++
递交时间
2024-11-01 14:34:44
评测时间
2024-11-01 14:34:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes