Language: C++

#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
  int num,a,ans;
  scanf("%d",&num);
  vector<long> n[num+1];
  n[0] = (long)0;
  for(int i = 1;i <= num;i++){
    scanf("%d",&a);
    n[i] = n[i-0]+a;
  }
  auto base = n.begin();
  auto next = base+1;
  sort(b,n.end());
  int accord = 1;
  ans = 0;
  while(base < n.end()-1){
    if(base == next){
      accord++;
    }else{
      count += accord*(accord-1)/2;
      base = next;
      accord = 1;
    }
    next++;
  }
  printf("%d",ans);
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: no match for 'operator=' (operand types are 'std::vector<long int>' and 'long int')
    9 |   n[0] = (long)0;
      |                ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'long int' to 'const std::vector<long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'long int' to 'std::vector<long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'long int' to 'std::initializer_list<long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:12:18: error: no match for 'operator+' (operand types are 'std::vector<long int>' and 'int')
   12 |     n[i] = n[i-0]+a;
      |            ~~~~~~^~
      |                 | |
      |                 | int
      |                 std::vector<long int>
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
                 from /usr/include/c++/14/vector:62:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
  627 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note:   template argument deduction/substitution failed:
a.cc:12:19: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   12 |     n[i] = n[i-0]+a;
      |                   ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
 1798 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note:   template argument deduction/substitution failed:
a.cc:12:19: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   12 |     n[i] = n[i-0]+a;
      |                   ^
a.cc:14:17: error: request for member 'begin' in 'n', which is of non-class type 'std::vector<long int> [(num + 1)]'
   14 |   auto base = n.begin();
      |                 ^~~~~
a.cc:16:8: error: 'b' was not declared in this scope
   16 |   sort(b,n.end());
      |        ^
a.cc:16:12: error: request for member 'end' in 'n', which is of non-class type 'std::vector<long int> [(num + 1)]'
   16 |   sort(b,n.end());
      |            ^~~
a.cc:19:18: error: request for member 'end' in 'n', which is of non-class type 'std::vector<long int> [(num + 1)]'
   19 |   while(base < n.end()-1){
      |                  ^~~
a.cc:23:34: error: overloaded function with no contextual type information
   23 |       count += accord*(accord-1)/2;
      |                                  ^