Language: C++

#include <iostream>
#include <array>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <string>
#include <limits>
#include <cassert>
#include <fstream>
#include <cstring>
#include <bitset>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <ciso646>

using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define inf INT_MAX/3
#define INF INT_MAX/3
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define in scanf
#define out printf
#define ll long long
#define ull unsigned long long
#define eps 1e-14
#define FST first
#define SEC second

#define int ll
signed main(void) {
	int N, A; cin >> N >> A;
	vector<int> X(N); for(auto &a:X) cin >> a;
	int maxX = *max_element(ALL(X));
	if(maxX < A){
		cout << -1 << endl;
		return 0;
	}
	vector<int> x(N);
	REP(i,N){
#include <iostream>
#include <array>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <string>
#include <limits>
#include <cassert>
#include <fstream>
#include <cstring>
#include <bitset>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <ciso646>

using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define inf INT_MAX/3
#define INF INT_MAX/3
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define in scanf
#define out printf
#define ll long long
#define ull unsigned long long
#define eps 1e-14
#define FST first
#define SEC second

#define int ll
signed main(void) {
	int N, A; cin >> N >> A;
	vector<int> X(N); for(auto &a:X) cin >> a;
	int maxX = *max_element(ALL(X));
	if(maxX < A){
		cout << 0 << endl;
		return 0;
	}
	vector<int> x(N);
	REP(i,N){
		x[i] = X[i] - A;
	}

	int dp[51][5002] = {};
	memset(dp, 0, sizeof(dp));

	dp[0][N*maxX] = 1;
	FOR(i,0,N){
		RFOR(j,0,2*N*maxX+1){
			if(0 <= j-x[i] and j-x[i] <= 2*N*maxX){
				dp[i+1][j] = dp[i][j-x[i]] + dp[i][j];
			}
			else{
				dp[i+1][j] = dp[i][j];
			}
		}
	}
	cout << dp[N][N*maxX] - 1 << endl;
	return 0;
}
		x[i] = X[i] - A;
	}

	int dp[51][5002] = {};
	memset(dp, 0, sizeof(dp));

	dp[0][N*maxX] = 1;
	FOR(i,0,N){
		RFOR(j,0,2*N*maxX+1){
			if(0 <= j-x[i] and j-x[i] <= 2*N*maxX){
				dp[i+1][j] = dp[i][j-x[i]] + dp[i][j];
			}
			else{
				dp[i+1][j] = dp[i][j];
			}
		}
	}
	cout << dp[N][N*maxX] - 1 << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:117:19: error: a function-definition is not allowed here before '{' token
  117 | signed main(void) {
      |                   ^