Language: Java

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  int N, A;
  cin >> N >> A;
  vector<int> X(N);
  rep(i, N) {
    cin >> X[i];
    X[i] -= A;
  }
  int MAX = 105 * 50;
  vector<vector<ll> > dp(N, vector<ll>(MAX));
  rep(i, N) {
    if(i == 0) {
      dp[i][MAX/2+X[i]] += 1;
      dp[i][MAX/2] += 1;
    } else {
      rep(j, MAX) {
        if(j+X[i] >= 0 && j+X[i] < MAX)
          dp[i][j+X[i]] += dp[i-1][j];
        dp[i][j] += dp[i-1][j];
      }
    }
  }
  cout << dp[N-1][MAX/2]-1 << endl;
  return 0;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: illegal character: '#'
#define ll long long
^
Main.java:3: error: class, interface, enum, or record expected
#define ll long long
        ^
Main.java:4: error: illegal character: '#'
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
^
Main.java:4: error: class, interface, enum, or record expected
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
                                       ^
Main.java:4: error: class, interface, enum, or record expected
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
                                                   ^
Main.java:5: error: illegal character: '#'
#define rep(i,n) REP(i,0,n)
^
Main.java:6: error: illegal character: '#'
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
^
Main.java:6: error: class, interface, enum, or record expected
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
                                        ^
Main.java:6: error: class, interface, enum, or record expected
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
                                                     ^
Main.java:7: error: illegal character: '#'
#define rrep(i,n) RREP(i,n-1,0)
^
Main.java:8: error: illegal character: '#'
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
^
Main.java:8: error: class, interface, enum, or record expected
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
                                      ^
Main.java:8: error: class, interface, enum, or record expected
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
                                                 ^
Main.java:9: error: illegal character: '#'
#define repl(i,n) REPL(i,0,n)
^
Main.java:10: error: illegal character: '#'
#define all(v) v.begin(), v.end()
^
Main.java:12: error: class, interface, enum, or record expected
const ll longinf = 1LL<<60;
^
Main.java:13: error: class, interface, enum, or record expected
const ll mod = 1e9+7;
^
Main.java:17: error: not a statement
  cin >> N >> A;
           ^
Main.java:18: error: not a statement
  vector<int> X(N);
                ^
Main.java:20: error: not a statement
    cin >> X[i];
        ^
Main.java:24: error: not a statement
  vector<vector<ll> > dp(N, vector<ll>(MAX));
                         ^
Main.java:24: error: not a statement
  vector<vector<ll> > dp(N, vector<ll>(MAX));
                                  ^
Main.java:24: error: not a statement
  vector<vector<ll> > dp(N, vector<ll>(MAX));
                                       ^
Main.java:37: error: not a statement
  cout << dp[N-1][MAX/2]-1 << endl;
                           ^
Main.java:15: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:18: error: ';' expected
  vector<int> X(N);
               ^
Main.java:18: error: ';' expected
  vector<int> X(N);
                 ^
Main.java:19: error: ';' expected
  rep(i, N) {
           ^
Main.java:24: error: ';' expected
  vector<vector<ll> > dp(N, vector<ll>(MAX));
                        ^
Main.java:24: error: ';' expected
  vector<vector<ll> > dp(N, vector<ll>(MAX));
                          ^
Main.java:24: error: ';' expected
  vector<vector<ll> > dp(N, vector<ll>(MAX));
                                      ^
Main.java:24: error: ';' expected
  vector<vector<ll> > dp(N, vector<ll>(MAX));
                                          ^
Main.java:25: error: ';' expected
  rep(i, N) {
           ^
Main.java:30: error: ';' expected
      rep(j, MAX) {
                 ^
36 errors