QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#353452#7606. Digital Nimucup-team241#Compile Error//C++146.9kb2024-03-14 09:12:052024-03-14 09:12:07

Details

answer.code:73:4: error: conflicting declaration ‘std::vector<int> eg [300005]’
   73 | vi eg[maxn];
      |    ^~
answer.code:69:10: note: previous declaration as ‘std::set<int> eg [300005]’
   69 | set<int> eg[maxn];
      |          ^~
answer.code: In function ‘int centroid(int)’:
answer.code:117:5: error: ‘dfs1’ was not declared in this scope; did you mean ‘dfs2’?
  117 |     dfs1(a);
      |     ^~~~
      |     dfs2
answer.code:121:22: error: no matching function for call to ‘max(std::vector<int>::size_type, int&)’
  121 |         int cur = max(visited.size() - sz[v], sz[son[v]]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:2:
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
answer.code:121:22: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long unsigned int’ and ‘int’)
  121 |         int cur = max(visited.size() - sz[v], sz[son[v]]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
answer.code:121:22: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long unsigned int’ and ‘int’)
  121 |         int cur = max(visited.size() - sz[v], sz[son[v]]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)’
 5795 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note:   template argument deduction/substitution failed:
answer.code:121:22: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long unsigned int’
  121 |         int cur = max(visited.size() - sz[v], sz[son[v]]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)’
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note:   template argument deduction/substitution failed:
answer.code:121:22: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long unsigned int’
  121 |         int cur = max(visited.size() - sz[v], sz[son[v]]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:122:13: error: ‘chkmin’ was not declared in this scope
  122 |         if (chkmin(bv, cur)) best = v;
      |             ^~~~~~
answer.code: In function ‘int lca(int, int)’:
answer.code:128:16: error: ‘u’ was not declared in this scope
  128 |     while (top[u] != top[v]) {
      |                ^
answer.code:128:26: error: ‘v’ was not declared in this scope
  128 |     while (top[u] != top[v]) {
      |                          ^
answer.code:132:13: error: ‘u’ was not declared in this scope
  132 |     if (dep[u] > dep[v]) swap(u, v);
      |             ^
answer.code:132:22: error: ‘v’ was not declared in this scope
  132 |     if (dep[u] > dep[v]) swap(u, v);
      |                      ^
answer.code:133:12: error: ‘u’ was not declared in this scope
  133 |     return u;
      |            ^
answer.code: In function ‘void add(int, int, int)’:
answer.code:160:16: error: cannot convert ‘ST**’ to ‘ST*’
  160 |         pushlz(root, dfn[top[v]], dfn[v], tp);
      |                ^~~~
      |                |
      |                ST**
answer.code:57:17: note:   initializing argument 1 of ‘void pushlz(ST*, int, int, int)’
   57 | void pushlz(ST *a, int l, int r, int lz) {
      |             ~~~~^
answer.code: In function ‘void worksub(int)’:
answer.code:185:25: error: request for member ‘total_cov’ in ‘*(ST**)(& root)’, which is of pointer type ‘ST*’ (maybe you meant to use ‘->’ ?)
  185 |     localans[a] = root->total_cov;
      |                         ^~~~~~~~~
answer.code: In function ‘void work(int)’:
answer.code:189:28: error: ‘dfs1’ was not declared in this scope; did you mean ‘dfs2’?
  189 |     dep[a] = 1, fa[a] = 0; dfs1(a);
      |                            ^~~~
      |                            dfs2
answer.code:192:21: error: too few arguments to function ‘std::vector<int> subtree(int, int)’
  192 |     vi vtx = subtree...