Language: C++

#include <bits/stdc++.h>
using namespace std;
vector< int > tree[200000+5];
int count[200000+5];
int arr[200000+5];
void dfs( int pos, int par,int value)
{
	value+=arr[pos];
  count[pos]=value;
  for ( int i=0;i<tree[pos].sz();i++)
  {
  	if ( tree[pos][i]!=par)
      dfs( tree[pos][i],pos,value);
 
  }
  value-=arr[pos];
}
int main()
{
  int n,q;
  cin>>n>>q;
  memset( arr,0,sizeof ( arr));
  memset( count,0,sizeof ( count);
  for ( int i=0;i<n-1;i++){
    int aa,bb;
    cin>>aa>>bb;
    tree[aa].push_back(bb);
    tree[bb].push_back(aa);
  }

     for ( int i=0;i<q;i++)
         {
           int aa,bb;
           cin>>aa>>bb;
           arr[aa]+=bb;}
         
         
}
    
  

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:9:3: error: reference to 'count' is ambiguous
    9 |   count[pos]=value;
      |   ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:4:5: note:                 'int count [200005]'
    4 | int count[200000+5];
      |     ^~~~~
a.cc:10:29: error: 'class std::vector<int>' has no member named 'sz'; did you mean 'size'?
   10 |   for ( int i=0;i<tree[pos].sz();i++)
      |                             ^~
      |                             size
a.cc: In function 'int main()':
a.cc:23:11: error: reference to 'count' is ambiguous
   23 |   memset( count,0,sizeof ( count);
      |           ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:4:5: note:                 'int count [200005]'
    4 | int count[200000+5];
      |     ^~~~~
a.cc:23:28: error: reference to 'count' is ambiguous
   23 |   memset( count,0,sizeof ( count);
      |                            ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:4:5: note:                 'int count [200005]'
    4 | int count[200000+5];
      |     ^~~~~