Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<numeric>
using namespace std;
typedef long long LL;
vector<LL>a;
vector<LL>b;
LL y=0;
int main(){
    int n;
    cin>>n;
    LL x;
    for(int i=0;i<n;i++){
    	cin>>x;
    	a.push_back(x);
	} 
    for(int i=0;i<n-1;i++)
    	b.push_back(abs(accumulate(a.begin(),a.at(i),y)-accumulate(a.at(i+1),a.end(),y)));
   	sort(b.begin(),b.end());
    cout<<b[0];
	return  0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:35: error: no matching function for call to 'accumulate(std::vector<long long int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, LL&)'
   21 |         b.push_back(abs(accumulate(a.begin(),a.at(i),y)-accumulate(a.at(i+1),a.end(),y)));
      |                         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   template argument deduction/substitution failed:
a.cc:21:35: note:   deduced conflicting types for parameter '_InputIterator' ('__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' and 'long long int')
   21 |         b.push_back(abs(accumulate(a.begin(),a.at(i),y)-accumulate(a.at(i+1),a.end(),y)));
      |                         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 3 provided
a.cc:21:67: error: no matching function for call to 'accumulate(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, std::vector<long long int>::iterator, LL&)'
   21 |         b.push_back(abs(accumulate(a.begin(),a.at(i),y)-accumulate(a.at(i+1),a.end(),y)));
      |                                                         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   template argument deduction/substitution failed:
a.cc:21:67: note:   deduced conflicting types for parameter '_InputIterator' ('long long int' and '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >')
   21 |         b.push_back(abs(accumulate(a.begin(),a.at(i),y)-accumulate(a.at(i+1),a.end(),y)));
      |                                                         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 3 provided