Language: C++

#include <iostream>

#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
using namespace std;

template<class T>
void in(vector<T>& V) {
	for (auto itr = V.begin(); itr != V.end(); itr++)cin >> *itr;
	return;
}

template<class T>
void out(vector<T>& V) {
	for (T& itr : V)cout << itr << endl;
	return;
}

vector<int> xa,xb;
vector < vector<long long >> suma;
vector<vector<long long>> sumb;   //[枚数][和]
int N, A;

int main() {
	cin >> N >> A;
	suma.resize(26, vector<int>(25 * 50 + 1, 0));
	sumb.resize(26,vector<int>(25*50+1,0));
	xa.resize(N/2);
	in(xa);
	xb.resize(N - N / 2);
	in(xb);
	//for (int codeb = 0; codeb < (1 << (N - N / 2)); codeb++) {
	//	int nn = 0, SS = 0;
	//	for (int n = 0; n < N - N / 2; n++) {
	//		if ((codeb >> n) & 1) {
	//			nn++;
	//			SS += xb[n];
	//		}
	//	}
	//	sumb[nn][SS]++;
	//}
	//for (int codea = 0; codea < (1 << (N / 2)); codea++) {
	//	int n = 0, S = 0;
	//	for (int c = 0; c < N / 2; c++) {
	//		if ((codea >> c) & 1) {
	//			n++;
	//			S += xa[c];
	//		}
	//	}
	//	suma[n][S]++;
	//}
	suma[0][0] = 1;
	for (int n = 0; n < N / 2; n++) {
		for (int pn = n; pn >= 0; pn--) {
			for (int S = xa[n]; S <= 25 * 50; S++) {
				suma[pn + 1][S] += suma[pn][S - xa[n]];
			}
		}
	}
	sumb[0][0] = 1;
	for (int n = 0; n < N - N / 2; n++) {
		for (int pn = n; pn >= 0; pn--) {
			for (int S = xb[n]; S <= 25 * 50; S++) {
				sumb[pn + 1][S] += sumb[pn][S - xb[n]];
			}
		}
	}
	long long ans = 0;
	for (int n = 0; n <= N / 2; n++) {
		for (int S = 0; S <= 25 * 50; S++) {
			for (int nn = 0; nn <= N - N / 2; nn++) {
				int SS = A * (n + nn) - S;
				if (SS < 0)continue;
				ans += suma[n][S] * sumb[nn][SS];
			}
		}
	}
	cout << ans-1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:20: error: no matching function for call to 'std::vector<std::vector<long long int> >::resize(int, std::vector<int>)'
   39 |         suma.resize(26, vector<int>(25 * 50 + 1, 0));
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1013:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int]'
 1013 |       resize(size_type __new_size)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1013:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1034:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type, const value_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; value_type = std::vector<long long int>]'
 1034 |       resize(size_type __new_size, const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1034:54: note:   no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<long long int> >::value_type&' {aka 'const std::vector<long long int>&'}
 1034 |       resize(size_type __new_size, const value_type& __x)
      |                                    ~~~~~~~~~~~~~~~~~~^~~
a.cc:40:20: error: no matching function for call to 'std::vector<std::vector<long long int> >::resize(int, std::vector<int>)'
   40 |         sumb.resize(26,vector<int>(25*50+1,0));
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1013:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int]'
 1013 |       resize(size_type __new_size)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1013:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1034:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type, const value_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; size_type = long unsigned int; value_type = std::vector<long long int>]'
 1034 |       resize(size_type __new_size, const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1034:54: note:   no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<long long int> >::value_type&' {aka 'const std::vector<long long int>&'}
 1034 |       resize(size_type __new_size, const value_type& __x)
      |                                    ~~~~~~~~~~~~~~~~~~^~~