Language: C++

#include<bits/stdc++.h>
using namespace std;

vector<int> a;
vector<vector<long long>> memo;
vector<vector<long long>> memoeven;


int main() {
  long long mod = 998244353;
  long long N, ans=0, sum=0; cin >> N;
  long long ttl=3;
  a = vector<long long>(N);
  for (int i=0; i<N; i++) {cin >> a[i]; sum+=a[i];}
  memo = vector<vector<long long>>(N+1, vector<long long>(sum+1, 0));
  memo[0][0]=1;
  memoeven = vector<vector<long long>>(N+1, vector<long long>(sum+1, 0));
  memoeven[0][0]=1;
  
  for (int i=0; i<N-1; i++) ttl = (ttl*3)%mod;
  
  for (int i=0; i<=N; i++) {
    for (int j=0; j<=sum; j++) {
      if (i==0&&j==0) continue;
      else if (i==0) memo[i][j]=0;
      else if (j-a[i-1]<0) memo[i][j]=memo[i-1][j]*2;
      else memo[i][j] = memo[i-1][j]*2+memo[i-1][j-a[i-1]];
    }
  }
  for (int j=(sum-1)/2+1; j<=sum; j++) ans +=memo[N][j]; 
  if (sum%2==0) {
    for (int i=0; i<=N; i++) {
      for (int j=0; j<=sum; j++) {
        if (i==0&&j==0) continue;
        else if (i==0) memoeven[i][j]=0;
        else if (j-a[i-1]<0) memoeven[i][j]=memoeven[i-1][j];
        else memoeven[i][j] = memoeven[i-1][j]+memoeven[i-1][j-a[i-1]];
      }
    }
    ans -= memoeven[N][sum/2];
  }
cout << ((ttl - ans*3)%mod+mod)%mod << "\n"; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'std::vector<long long int>')
   13 |   a = vector<long long>(N);
      |                          ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/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 = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::vector<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 = int; _Alloc = std::allocator<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 'std::vector<long long int>' to 'std::vector<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 = int; _Alloc = std::allocator<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 'std::vector<long long int>' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~