QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#756212#9570. Binary Treeucup-team4412Compile Error//C++142.0kb2024-11-16 19:22:182024-11-16 19:22:18

详细

answer.code: In function ‘void solve()’:
answer.code:10:16: error: missing template arguments before ‘p’
   10 |         vector p(n+1,vector<int>());
      |                ^
answer.code:13:22: error: ‘p’ was not declared in this scope
   13 |                 if(x)p[i].push_back(x),p[x].push_back(i);
      |                      ^
answer.code:14:22: error: ‘p’ was not declared in this scope
   14 |                 if(y)p[i].push_back(y),p[y].push_back(i);
      |                      ^
answer.code: In lambda function:
answer.code:23:35: error: ‘p’ was not declared in this scope
   23 |                         for(int y:p[x]){
      |                                   ^
answer.code: In lambda function:
answer.code:53:35: error: ‘p’ was not declared in this scope
   53 |                         for(int y:p[x]){
      |                                   ^
answer.code: In function ‘void solve()’:
answer.code:61:28: error: ‘p’ was not declared in this scope
   61 |                 for(auto y:p[rt2])if(!vis[y]){
      |                            ^
answer.code:62:38: error: no matching function for call to ‘std::vector<std::array<int, 2> >::push_back(<brace-enclosed initializer list>)’
   62 |                         tmp.push_back({sz[y],y});
      |                         ~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/queue:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:157,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_vector.h:1278:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::array<int, 2>; _Alloc = std::allocator<std::array<int, 2> >; value_type = std::array<int, 2>]’
 1278 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:35: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::vector<std::array<int, 2> >::value_type&’ {aka ‘const std::array<int, 2>&’}
 1278 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:1295:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::array<int, 2>; _Alloc = std::allocator<std::array<int, 2> >; value_type = std::array<int, 2>]’
 1295 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1295:30: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<std::array<int, 2> >::value_type&&’ {aka ‘std::array<int, 2>&&’}
 1295 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
answer.code: In lambda function:
answer.code:68:35: error: ‘p’ was not declared in this scope
   68 |                         for(int y:p[x]){
      |                                   ^