Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    ll n,ans=0;
    cin >> n;
    vector<int, vector<int>> l(n), r(n);
    rep(i, n){
        int a;
        cin >> a;
        l.at(a + i).push_back(i);
        if(j-a>0){
            r.at(j - a).push_back(i);
        }
    }
    rep(i,n){
        ans += min(l.at(i).size(), r.at(i).size());
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: request for member 'push_back' in 'l.std::vector<int, std::vector<int> >::at(((std::vector<int, std::vector<int> >::size_type)(a + i)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::vector<int>, int>::value_type' {aka 'int'}
   14 |         l.at(a + i).push_back(i);
      |                     ^~~~~~~~~
a.cc:15:12: error: 'j' was not declared in this scope
   15 |         if(j-a>0){
      |            ^
a.cc:20:28: error: request for member 'size' in 'l.std::vector<int, std::vector<int> >::at(((std::vector<int, std::vector<int> >::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::vector<int>, int>::value_type' {aka 'int'}
   20 |         ans += min(l.at(i).size(), r.at(i).size());
      |                            ^~~~
a.cc:20:44: error: request for member 'size' in 'r.std::vector<int, std::vector<int> >::at(((std::vector<int, std::vector<int> >::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::vector<int>, int>::value_type' {aka 'int'}
   20 |         ans += min(l.at(i).size(), r.at(i).size());
      |                                            ^~~~
In file included from /usr/include/c++/14/ext/alloc_traits.h:34,
                 from /usr/include/c++/14/bits/basic_string.h:39,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/alloc_traits.h: In instantiation of 'static void std::allocator_traits< <template-parameter-1-1> >::deallocate(_Alloc&, pointer, size_type) [with _Alloc = std::vector<int>; pointer = int*; size_type = long unsigned int]':
/usr/include/c++/14/bits/stl_vector.h:389:19:   required from 'void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = int; _Alloc = std::vector<int>; pointer = int*; std::size_t = long unsigned int]'
  389 |           _Tr::deallocate(_M_impl, __p, __n);
      |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:368:2:   required from 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int; _Alloc = std::vector<int>]'
  368 |         _M_deallocate(_M_impl._M_start,
      |         ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:557:47:   required from 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = int; _Alloc = std::vector<int>; size_type = long unsigned int; allocator_type = std::vector<int>]'
  557 |       : _Base(_S_check_init_len(__n, __a), __a)
      |                                               ^
a.cc:10:33:   required from here
   10 |     vector<int, vector<int>> l(n), r(n);
      |                                 ^
/usr/include/c++/14/bits/alloc_traits.h:362:13: error: 'class std::vector<int>' has no member named 'deallocate'; did you mean '_M_allocate'?
  362 |       { __a.deallocate(__p, __n); }
      |         ~~~~^~~~~~~~~~
      |         _M_allocate
/usr/include/c++/14/bits/alloc_traits.h: In instantiation of 'static std::allocator_traits< <template-parameter-1-1> >::pointer std::allocator_traits< <template-parameter-1-1> >::allocate(_Alloc&, size_type) [with _Alloc = std::vector<int>; pointer = int*; size_type = long unsigned int]':
/usr/include/c++/14/bits/stl_vector.h:380:33:   required from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = int; _Alloc = std::vector<int>; pointer = int*; std::size_t = long unsigned int]'
  380 |         return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
      |                           ~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:398:33:   required from 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = int; _Alloc = std::vector<int>; std::size_t = long unsigned int]'
  398 |         this->_M_impl._M_start = this->_M_allocate(__n);
      |                                  ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:334:9:   required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = int; _Alloc = std::vector<int>; std::size_t = long unsigned int; allocator_type = std::vector<int>]'
  334 |       { _M_create_storage(__n); }
      |         ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:557:47:   required from 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = int; _Alloc = std::vector<int>; size_type = long unsigned int; allocator_type = std::vector<int>]'
  557 |       : _Base(_S_check_init_len(__n, __a), __a)
      |                                               ^
a.cc:10:33:   required from here
   10 |     vector<int, vector<int>> l(n), r(n);
      |                                 ^
/usr/include/c++/14/bits/alloc_traits.h:335:20: error: 'class std::vector<int>' has no member named 'allocate'; did you mean '_M_allocate'?
  335 |       { return __a.allocate(__n); }
      |                ~~~~^~~~~~~~
      |                _M_allocate