criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  ll N,A,i,j,k;cin>>N>>A;ll X[N],DP[N+1][4901];
  REP(i,N){cin>>X[i];X[i]-=A;}
  REP(i,4901)DP[0][i]=0;DP[0][2450]=1;
  FOR(i,1,N+1)REP(j,2450)if(j-A[i-1]>=0&&j-A[i-1]<=4900)DP[i][j]=DP[i][j-A[i-1]]+1;
  cout<<DP[N][2450]-1<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   14 |   FOR(i,1,N+1)REP(j,2450)if(j-A[i-1]>=0&&j-A[i-1]<=4900)DP[i][j]=DP[i][j-A[i-1]]+1;
      |                                ^
a.cc:14:45: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   14 |   FOR(i,1,N+1)REP(j,2450)if(j-A[i-1]>=0&&j-A[i-1]<=4900)DP[i][j]=DP[i][j-A[i-1]]+1;
      |                                             ^
a.cc:14:75: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   14 |   FOR(i,1,N+1)REP(j,2450)if(j-A[i-1]>=0&&j-A[i-1]<=4900)DP[i][j]=DP[i][j-A[i-1]]+1;
      |                                                                           ^
Language: C++

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

//部分点解法

int main(){
	int n,a;
	cin >> n >> a;
	vector<int> x(n);
	rep(i,n){
		cin >> x[i];
	}
	
	ll ans = 0;
	rep(bit, 1<<n){
		if(bit == 0) continue;
		ll sum = 0;
		ll count = 0;
		rep(i,n){
			if(bit & (1<<i)){
				sum += x[i];
				count++;
			}
		}
		if(a*count == sum) {
			ans++;
		}
		
	}
	
	cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int main(){
      | ^~~
Language: Java


import lib.FastScanner;

public class Main {
    public static void main(String[] args) {
        FastScanner fsc = new FastScanner();
        int n = fsc.nextInt();
        int a = fsc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = fsc.nextInt() - a;
        }
        long[][] dp = new long[n][5010];
        int inflation = 2505;
        dp[0][0 + inflation] = 1;
        dp[0][x[0] + inflation] += 1;
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < 5010; j++) {
                if (dp[i - 1][j] > 0) {
                    dp[i][j] += dp[i - 1][j];
                    dp[i][j + x[i]] += dp[i - 1][j];
                }
            }
        }
        System.out.println(dp[n - 1][0 + inflation] - 1);
    }
}


Compiler output:
Main.java:2: error: package lib does not exist
import lib.FastScanner;
          ^
Main.java:6: error: cannot find symbol
        FastScanner fsc = new FastScanner();
        ^
  symbol:   class FastScanner
  location: class Main
Main.java:6: error: cannot find symbol
        FastScanner fsc = new FastScanner();
                              ^
  symbol:   class FastScanner
  location: class Main
3 errors
Language: C++

fun main(args: Array<String>) {
    val (n, a) = readLine()!!.split(" ").map(String::toInt)
    var dp = Array(n+1, {Array(a*n+1, {0.toLong()})}) 
    var dp_copy = Array(n+1, {Array(a*n+1, {0.toLong()})}) 
    val x = readLine()!!.split(" ").map(String::toInt)
    dp[0][0] = 1.toLong()
    dp_copy[0][0] = 1.toLong()
    for(i in 1..n){
        for(j in 0..n-1){
            for(k in 0..n*a-x[i-1]){
                dp_copy[j+1][k+x[i-1]] += dp[j][k]
            }
        }
        for(j in 0..n){
            for(k in 0..n*a){
                dp[j][k] = dp_copy[j][k]
            }
        }
    }
    var ans = 0.toLong()
    for(i in 1..n) ans += dp[i][i*a]
    println(ans)
}

Compiler output:
a.cc:8:14: error: too many decimal points in number
    8 |     for(i in 1..n){
      |              ^~~~
a.cc:9:18: error: too many decimal points in number
    9 |         for(j in 0..n-1){
      |                  ^~~~
a.cc:10:22: error: too many decimal points in number
   10 |             for(k in 0..n*a-x[i-1]){
      |                      ^~~~
a.cc:14:18: error: too many decimal points in number
   14 |         for(j in 0..n){
      |                  ^~~~
a.cc:15:22: error: too many decimal points in number
   15 |             for(k in 0..n*a){
      |                      ^~~~
a.cc:21:14: error: too many decimal points in number
   21 |     for(i in 1..n) ans += dp[i][i*a]
      |              ^~~~
a.cc:1:1: error: 'fun' does not name a type
    1 | fun main(args: Array<String>) {
      | ^~~
Language: C++

#include <string>
#include <map>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, sta, n) for (int i = sta; i < n; ++i)

using namespace std;
typedef long long ll;
const int mod = 1000000007;

ll dp[55][55][2555];

int main() {
    int N, A;
    cin >> N >> A;
    vector<int> x(N);
    rep(i, N) cin >> x[i];
    int sum = 0;
    rep(i, N) sum += x[i];

    dp[0][0][0] = 1;

    rep(j, N+1) {
        rep(k, N+1) {
            rep(l, sum+1) {
                if (j>=1 && k>=0 && l<x[j-1]) {
                    dp[j][k][l] = dp[j-1][k][l];
                }
                else if (j>=1 && k>=1 && l>=x[j-1]) {
                    dp[j][k][l] = dp[j-1][k][l] + dp[j-1][k-1][l-x[j-1]];
                }
                else if (j==0 && k==0 && l==0) dp[j][k][l] = 1;
                else dp[j][k][l] = 0;   
            }    
        }
    } 
    ll ans = 0;
   
    for (int k=1; A*k<=sum; k++) {
        ans += dp[N][k][A*k];
    }
    
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'cin' was not declared in this scope
   15 |     cin >> N >> A;
      |     ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <map>
  +++ |+#include <iostream>
    3 | 
a.cc:16:5: error: 'vector' was not declared in this scope
   16 |     vector<int> x(N);
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <map>
  +++ |+#include <vector>
    3 | 
a.cc:16:12: error: expected primary-expression before 'int'
   16 |     vector<int> x(N);
      |            ^~~
a.cc:17:22: error: 'x' was not declared in this scope
   17 |     rep(i, N) cin >> x[i];
      |                      ^
a.cc:19:22: error: 'x' was not declared in this scope
   19 |     rep(i, N) sum += x[i];
      |                      ^
a.cc:26:39: error: 'x' was not declared in this scope
   26 |                 if (j>=1 && k>=0 && l<x[j-1]) {
      |                                       ^
a.cc:43:5: error: 'cout' was not declared in this scope
   43 |     cout << ans << endl;
      |     ^~~~
a.cc:43:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:20: error: 'endl' was not declared in this scope
   43 |     cout << ans << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <map>
  +++ |+#include <ostream>
    3 |
Language: C++

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

int main() {
    int N, A;
    cin >> N >> A;
    vector<int> x(N);
    rep(i, 0, N) cin >> x[i], x[i] -= A;
    vector<vector<long long>> dp(N + 1, vector<long long>(5555));
    int g = 2500;
    dp[0][g] = 1;
    rep(i, 0, N) rep(j, -g, g) {
        dp[i + 1][j + g] += dp[i][j + g];
        dp[i + 1][j + g + x[i]] += dp[i][j + g];
    }
    cout << dp[N][g] - 1 << endl;
    return 0;
}
a

Compiler output:
a.cc:20:1: error: 'a' does not name a type
   20 | a
      | ^
Language: C++

#include<iostream>
using namespace std;
long dp[55][55][600];
main(){
  int n,v;
  cin>>n>>v;
  ll x[n];
  for(int i=0;i<n;++i)cin>>x[i];
  
  dp[0][0][0]=1;
  for(int i=0;i<n;++i){
    for(int j=0;j<i;++j){
      for(int k=0;k<550;++k){
        dp[i+1][j][k]+=dp[i][j][k];
        dp[i+1][j+1][k+x[i]]+=dp[i][j][k];
      }
    }
  }
  
  long ans=0;
  for(int i=0;i<n;++i)
    ans+=dp[n][i][i*v];
  cout<<ans<<endl;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll x[n];
      |   ^~
a.cc:8:28: error: 'x' was not declared in this scope
    8 |   for(int i=0;i<n;++i)cin>>x[i];
      |                            ^
a.cc:15:24: error: 'x' was not declared in this scope
   15 |         dp[i+1][j+1][k+x[i]]+=dp[i][j][k];
      |                        ^
Language: C++

#include <bits/stdc++.h>
#define reps(i,a,b) for(long long int i=a;i<b;i++)
#define rep(i,a) for(long long int i=0;i<a;i++)
typedef long long int ll;
using namespace std;
ll MOD = 1000000007;

ll dp[55][55][200000];
int N,A;
int x[50];
const int MAX = 510000;

struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;

//再帰関数、下の方を先に計算させる感覚

ll dpp(int basho,int maisu,int gouke){
    if(basho>=N){
        if(gouke==maisu*A && maisu!=0){
        return 1;//一番下では１（？）
        }
        else{
            return 0;
        }
    }
    if (dp[basho][maisu][gouke] != -1){
        return dp[basho][maisu][gouke];
    }


    int yes = dpp(basho+1,maisu+1,gouke+x[basho]);
    int no = dpp(basho+1,maisu,gouke);

    dp[basho][maisu][gouke]= yes+no;
    
    return dp[basho][maisu][gouke];
}



int main(){
    cin>>N>>A;
    rep(i,N){
        cin>>x[i];
    }
    memset(dp, -1, sizeof(dp));//初期化

    cout<<dpp(0,0,0)<<endl;



    return 0;
}

Compiler output:
/tmp/cc66Mgtk.o: in function `dpp(int, int, int)':
a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc66Mgtk.o
a.cc:(.text+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/cc66Mgtk.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc66Mgtk.o
/tmp/cc66Mgtk.o: in function `main':
a.cc:(.text+0x194): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc66Mgtk.o
a.cc:(.text+0x1b0): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/cc66Mgtk.o
a.cc:(.text+0x1d8): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc66Mgtk.o
a.cc:(.text+0x1f8): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc66Mgtk.o
/tmp/cc66Mgtk.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x26b): relocation truncated to fit: R_X86_64_PC32 against symbol `aaaaaaa' defined in .bss section in /tmp/cc66Mgtk.o
collect2: error: ld returned 1 exit status
Language: C

#include <bits/stdc++.h>
using namespace std;
 
using lint = long long;
const lint LINF = 1e18;
 
lint digit_sum(lint n, lint b) {
    lint res = 0;
    while (n > 0) {
        res += n % b;
        n /= b;
    }
    return res;
}
 
int main() {
    lint n, s;
    cin >> n >> s;
 
    lint ans;
    if (n == s) {
        ans = n + 1;
    } else {
        ans = LINF;
        for (lint b = 2; b * b <= n; b++) {
            if (digit_sum(n, b) == s) {
                ans = min(ans, b);
            }
        }
        for (lint p = 1; p * p < n; p++) {
            if ((n - s) % p == 0) {
                lint b = lint(1) + (n - s) / p;
                if (0 <= p and p < b and 0 <= s - p and s - p < b) {
                    ans = min(ans, b);
                }
            }
        }
    }
    if (ans == LINF) {
        cout << -1 << endl;
    } else {
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N = keyboard.nextInt();
		int A = keyboard.nextInt();
		int[] in = new int[N];
		for(int i=0; i < N; i++) {
			in[i] = keyboard.nextInt();
		}
		
		for (int i = 0; i < N; i++) {
			in[i] -= A;
		}
		
		long[][] masu = new long[51][5001];
		
		masu[0][2500] = 1;
		
		for(int j = 1; j < N+1; j++) {
			for(int k = 0; k < 5001; k++) {
				if(k-in[j-1] >= 0 && k-in[j-1] <= 5000) {
				masu[j][k] += masu[j-1][k-in[j-1]];
				masu[j][k] += masu[j-1][k];
				}
			}
		}
			
		System.out.println(masu[N][2500]-1);
		keyboard.close();
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner keyboard = new Scanner(System.in); 
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner keyboard = new Scanner(System.in); 
		                       ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0))
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0))
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a))
#define Reverse(a) reverse(All(a))
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
#define Lower(a,t) lower_bound(All(a),t)
using namespace std;
int max_int = 1000000007;
void Debug(auto a);
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int nienu(int n){
    int ans = 1;
    REP(i,n){
        ans *= 2;
    }
    return ans;
}

signed main(){
    int n,a;
    cin >> n >> a;
    vec(b,55);
    vec(c,55);
    REP(i,n){
        int t;
        cin >> t;
        if(t-a>0){
            b[t-a]++;
        }
        else{
            c[a-t]++;
        }
    }
    int kake = nienu(c[0]);
    int ans_t = 1;
    FOR(i,1,n){
        ans_t += a[i]*b[i];
    }
    ans_t *= kake;
    ans_t--;
    cout << ans_t << endl;


    
    return 0;
}



void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}


Compiler output:
a.cc:18:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   18 | void Debug(auto a);
      |            ^~~~
a.cc: In function 'int main()':
a.cc:71:19: error: invalid types 'long long int[long long int]' for array subscript
   71 |         ans_t += a[i]*b[i];
      |                   ^
a.cc: At global scope:
a.cc:84:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   84 | void Debug(auto a){
      |            ^~~~
Language: C++

#include <iostream>
#include <stdio.h>

#define maxn 51
#define maxsum 5000
using namespace std;
int N, A;
// dp[i][j][k] = j carti din primele i carti care dau suma k
// dp[1][0][0] = 1
// dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - v[i]]
long long dp[maxn][maxn][maxsum];
int v[maxn];
int main()
{
    int mini = 100;
    long long rez = 0;
    scanf("%d %d", &N, &A);
    for (int i = 1; i <= N; ++i) {
        scanf("%d", &v[i]);
        mini = min(v[i], mini);
        // dp[i][1][v[i]] = 1;
        dp[i][0][0] = 1;
    }
    dp[0][0][0] = 1;
    for (int i = 1; i <= N; ++i) {
        for (int j = 1; j <= i; ++j) {
            for (int k = 0; k <= maxsum; ++k) {
                dp[i][j][k] = dp[i - 1][j][k];
                if (k - v[i] >= 0) {
                    dp[i][j][k] += dp[i - 1][j - 1][k - v[i]];
                }
        }
    }
    for (long long i = 1; i <= N; ++i) {
        rez += dp[N][i][i * A];
    }
    printf("%lld", rez);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:14:1: note: to match this '{'
   14 | {
      | ^
Language: C++

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

//using
using VI = vector<int>;
using VVI = vector<VI>;
using VS = vector<string>;
using PII = pair<int, int>;
using LL = long long;

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  for(int i=0;i<(n);i++)

//constant
const int INF = 1 << 29;
const double EPS = 1e-10;
const double PI = acos(-1.0);

//debug
#define dump(x)  cout << #x << " = " << (x) << endl;

int main() {
  int N, A;
  cin >> N >> A;
  VI x(N);
  REP(i, N) cin >> x[i];
  sort(x.begin(), x.end());
  vector<set<int>> sum;
  int ans = 0;
  REP(i, N) {
    REP(j, sum.size()) { //j個選んだときの合計値がsetとしてsumに入っている．
      sum[j];
    }
  }
  cout << cost << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:12: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::set<int>; _Alloc = std::allocator<std::set<int> >; reference = std::set<int>&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   45 |       sum[j];
      |            ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/queue:63,
                 from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:48:11: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   48 |   cout << cost << endl;
      |           ^~~~
      |           cosl
Language: C++

//#include<stdio.h>
//#include<stdlib.h>
//#include<string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=55;
int main()
{
    int n;
    int a;
//for(auto &a:b)
//存在n*n种组合方法，求解满足条件的方法，遍历？
    cin>>n>>a；
        int b[N][N*N]={0};
        int p;
        ll cnt=0;//计算方法数
        b[0][0]=1;
        for(int i=1; i<=n; i++)
        {
            cin>>p;
            for(int j=i-1; j>=0; j--)
            {
                for(int k=0; k<=N*j; k++)
                {
                    b[j+1][p+k]+=b[j][k];//将每一种可能加到一个p+k，使得每一个可能的和的地方数组储存的数字都为1
                }
            }
        }
        for(int i=1; i<=n; i++)
        {
            cnt+=b[i][i*a];//若是i*a处不为0则说明p+k可以加到这个位置
        }
        cout<<cnt<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'a\U0000ff1b' was not declared in this scope
   14 |     cin>>n>>a；
      |             ^~~
a.cc:18:9: error: 'b' was not declared in this scope
   18 |         b[0][0]=1;
      |         ^
Language: C++

//#include<stdio.h>
//#include<stdlib.h>
//#include<string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=60;
int main()
{
    int n;
    int a;
//for(auto &a:b)
//存在n*n种组合方法，求解满足条件的方法，遍历？
    cin>>n>>a；
        int b[N][N*N]={0};
        int p;
        ll cnt=0;//计算方法数
        b[0][0]=1;
        for(int i=1; i<=n; i++)
        {
            cin>>p;
            for(int j=i-1; j>=0; j--)
            {
                for(int k=0; k<=N*j; k++)
                {
                    b[j+1][p+k]+=b[j][k];//将每一种可能加到一个p+k，使得每一个可能的和的地方数组储存的数字都为1
                }
            }
        }
        for(int i=1; i<=n; i++)
        {
            cnt+=b[i][i*a];//若是i*a处不为0则说明p+k可以加到这个位置
        }
        cout<<cnt<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'a\U0000ff1b' was not declared in this scope
   14 |     cin>>n>>a；
      |             ^~~
a.cc:18:9: error: 'b' was not declared in this scope
   18 |         b[0][0]=1;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
LL dp[51][51][2501];
int main()
{
	//freopen("In.txt" , "r" , stdin);
	int N , A;
	cin >> N >> A;
	vector<int> a(N);
	for(auto &x : a)
		cin >> x;
	dp[0][0][0] = 1;
	for(int i = 0; i < N; i++)
	{
		for(int picked = 0; picked <= 50; picked++)
		{
			for(int sum = 0; sum <= i * 50; sum++)
			{
				dp[i + 1][picked + 1][sum + a[i]] +=
				dp[i][picked][sum];
				dp[i + 1][picked][sum] += dp[i][picked][sum];
			}
		}
	}
	LL ans = 0;
	for(int picked = 1; picked <= N; picked++)
		ans += dp[N][picked][picked * A];
	cout << ans;
	return 0;
}


Compiler output:
a.cc:3:1: error: 'LL' does not name a type
    3 | LL dp[51][51][2501];
      | ^~
a.cc: In function 'int main()':
a.cc:12:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   12 |         dp[0][0][0] = 1;
      |         ^~
      |         dup
a.cc:25:9: error: 'LL' was not declared in this scope
   25 |         LL ans = 0;
      |         ^~
a.cc:27:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |                 ans += dp[N][picked][picked * A];
      |                 ^~~
      |                 abs
a.cc:28:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define vong1(i,a,b) for(int i=a;i<b;i++)
int N, A;
int x[50];
long p[100][100]10000];
//-----------------------------------------------------------------
int main() 
{
	
	cin >> N >> A;
	vong1(i, 0, N) cin >> x[i];
 
	p[0][0][0] = 1;
	vong1(i, 0, N) 
	{
		vong1(j, 0, N)
		{
			vong1(k, 0, 2500)
			{
				if(p[i][j][k])
				{
					p[i + 1][j][k] += p[i][j][k];
					p[i + 1][j + 1][k + x[i]] += p[i][j][k];
				}
			}
		}
	}  
 
	long ans = 0;
	vong1(i, 1, N + 1) ans += p[N][i][i*A];
	cout << ans << endl;
}

Compiler output:
a.cc:6:17: error: expected initializer before numeric constant
    6 | long p[100][100]10000];
      |                 ^~~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'p' was not declared in this scope
   14 |         p[0][0][0] = 1;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define vong1(i,a,b) for(int i=a;i<b;i++)
int N, A;
int x[50];
long p[51][51][3010];
//-----------------------------------------------------------------
int main() 
{
	
	cin >> N >> A;
	vong1(i, 0, N) cin >> x[i];
 
	p[0][0][0] = 1;
	vong1(i, 0, N) 
	{
		vong1(j, 0, N)
		{
			vong1(k, 0, 2500)
			{
				if(p[i][j][k])]
				{
					p[i + 1][j][k] += p[i][j][k];
					p[i + 1][j + 1][k + x[i]] += p[i][j][k];
				}
			}
		}
	}  
 
	long ans = 0;
	vong1(i, 1, N + 1) ans += p[N][i][i*A];
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:47: error: expected primary-expression before ']' token
   21 |                                 if(p[i][j][k])]
      |                                               ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
int N,A;
ll dp[51][2501],ans;
vector<int> a(N);
int main()
{
	cin>>N>>A;
	for (int& x: a) cin>>x;
	dp[0][0]=1;
	for (int x: a)
	{
		for (int k=50;k>=0;k--)
			for (int y=0;y<=2500;y++)
			{
				if (!dp[k][y]) continue;      //dp[k][y]表示 取其中k张卡片,总和为y的方案数 
				dp[k+1][y+t]+=dp[k][y];
			}
	}	
	for (int k=1;k<=50;k++)
		for (int y=0;y<=2500;y++)
			if (k*A==y) ans+=dp[k][y];
	cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:43: error: 't' was not declared in this scope
   20 |                                 dp[k+1][y+t]+=dp[k][y];
      |                                           ^
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=1e5+5,L=20;
typedef long long ll;
int a[N];
int p[N][L];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    int L;
    scanf("%d",&L);
    for(int i=1,j=1;i<=n;i++){
        while(x[j]+L<x[i])
            j++;
        p[i][0]=j;
    }
    for(int i=1;i<=n;i++)
        for(int j=1;(1<<j)<=i;j++)
            p[i][j]=p[p[i][j-1]][j-1];
    int q;
    scanf("%d",&q);
    while(q--){
        int l,r;
        scanf("%d%d",&l,&r);
        if(l>r)
            swap(l,r);
        int g=0;
        while(1<<g<=r)
            g--;
        int ans=0;
        for(int i=g;i>=0;i--)
            if(p[r][j]>=l)
                r=p[r][j],ans+=1<<i;
        if(r>l)
            ans++;
        printf("%d\n",ans);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'x' was not declared in this scope
   19 |         while(x[j]+L<x[i])
      |               ^
a.cc:38:21: error: 'j' was not declared in this scope
   38 |             if(p[r][j]>=l)
      |                     ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
	ll n,a;
	cin >> n >> a;
	vector<ll>x(n+1);
	for(int i = 1; i <= n; i++){
		cin >> x[i];
	}

	ll dp[51][51][50*50+1] = {0};

	for(int i = 0; i <= n; i++){
		dp[i][0][0]=1;
	}

	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			for(int k = 0; k <=; k++){
				if(k-x[i] >= 0){
					dp[i][j][k] = dp[i-1][j-1][k-x[i]] + dp[i-1][j][k];
				}else{
					dp[i][j][k] = dp[i-1][j][k];
				}
			}
		}
	}


	ll ans = 0;

	for(int j = 1; j <= n; j++){
		//cout << ans << endl;
		ans += dp[n][j][j*a];
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:44: error: expected primary-expression before ';' token
   38 |                         for(int k = 0; k <=; k++){
      |                                            ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<stdlib.h>
#include<stack>
using namespace std;
const int N=1e5+50;
const int INF=0x3f3f3f;
long long dp[N][N];
long long sum;
int main()
{
    int n,m,a,b;
    scanf("%d%d",&n,&m);
    dp[0][0]=1;
    sum=0;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&b);
        for(int j=i;j>=0;j--)
            {
                for(int k=m*n;k>=b;k--)
                {
                   dp[j][k]+=dp[j-1][k-b];
                }
            }
    }
    for(int i=1;i<=n;i++)
        sum+=dp[i][i*m];
    printf("%lld\n",sum);
    return 0;
}

Compiler output:
/tmp/cc74N2Xa.o: in function `main':
a.cc:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc74N2Xa.o
a.cc:(.text+0x16b): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc74N2Xa.o
a.cc:(.text+0x175): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc74N2Xa.o
a.cc:(.text+0x188): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc74N2Xa.o
collect2: error: ld returned 1 exit status
Language: C++

///
// File:  c.go
// Author: ymiyamoto
//
// Created on Sat Feb 24 18:11:43 2018
//
package main

import (
	"fmt"
)

func main() {
	var N, A int
	fmt.Scan(&N, &A)

	cards := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&cards[i])
	}

	dp := make([][][]int64, N+1)
	for i := range dp {
		dp[i] = make([][]int64, N+1)
		for j := range dp[i] {
			dp[i][j] = make([]int64, 251)
		}
	}

	dp[0][0][0] = 1
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			for k := 0; k <= 250; k++ {
				if k+cards[i] <= 250 {
					dp[i+1][j+1][k+cards[i]] += dp[i][j][k]
				}
				dp[i+1][j][k] += dp[i][j][k]
			}
		}
	}

	var count int64 = 0
	for i := 1; i <= N; i++ {
		count += dp[N][i][A*i]
	}

	fmt.Println(count)
}


Compiler output:
a.cc:7:1: error: 'package' does not name a type
    7 | package main
      | ^~~~~~~
Language: C++

//In the name of God
#include<bits/stdc++.h>
#define int long long

using namespace std;

int n , A , a[60] , dp[60][60][3000];

int32_t main(){
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        cin >> n >> A;
        for(int i=1 ; i <= n ; i++)
                cin >> a[i];
        dp[0][0][0] = 1;
        for(int i=1 ; i <= n ; i++){
                dp[i][0][0] = 1;
                for(int j=1 ; j <= i ; j++)
                        for(int k=1 ; k < 2800 ; k++){
                                dp[i][j][k] = dp[i-1][j][k];
                                if(k >= a[i])
                                        dp[i][j][k] += dp[i-1][j-1][k - a[i]];
                        }
        }
        int res = 0;
        for(int i=1 ; i <= n ; i++)
                res += dp[n][i][i*A];
        cout << res;
}       
~          

Compiler output:
a.cc:31:2: error: expected class-name at end of input
   31 | ~
      |  ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int dp[50][50][50 * 50];

int main(void) {
    int N, A;
    cin >> N >> A;
    vector<int> x;
    x.push_back(0);
    for (int i = 0; i < N; ++i) {
        int x_in;
        cin >> x_in;
        x.push_back(x_in);
    }

    int X = *max_element(x.begin(), x.end());

    for (int j = 0; j <= N; ++j) {
        for (int k = 0; k <= N; ++k) {
            for (int s = 0; s <= N * X; ++s) {
                if (j == 0 && k == 0 && s == 0) {
                    dp[j][k][s] = 1;
                } else if (j >= 1 && s < x[j]) {
                    dp[j][k][s] = dp[j - 1][k][s];
                } else if (j >= 1 && k >= 1 && s >= x[j]) {
                    dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
                } else {
                    dp[j][k][s] = 0;
                }
            }
        }
    }

    long long num = 0;
    for (int k = 1; k <= N; ++k) {
        num += dp[N][k][k * A];
    }

    cout << num << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'max_element' was not declared in this scope
   19 |     int X = *max_element(x.begin(), x.end());
      |              ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> int_pair;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
const int N=50;
const int NX = 2500;
 
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,a,x[N+1];
	int dp[N+1][N+1][NX+1];
	cin >> n >> a;
	FOR(i,1,n+1)cin >> x[i];
	FOR(j,0,n+1){
		FOR(k,0,n+1){
			FOR(s,0,n*50+1){
				if(j==0 && k==0 && s==0)dp[0][0][0]=1;
				else if(j>=1 && s<x[j])
					dp[j][k][s]=dp[j-1][k][s];
				else if(j>=1 && k>=1 && s>=x[j])
					dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j]];
				else dp[j][k][s]=0;
			}
		}
	}
	unsigned ll ans=0;
	FOR(k,1,n+1){
		ans += dp[n][k][k*a];
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: expected initializer before 'ans'
   29 |         unsigned ll ans=0;
      |                     ^~~
a.cc:31:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |                 ans += dp[n][k][k*a];
      |                 ^~~
      |                 abs
a.cc:33:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,a;
    cin>>n>>a;
    vector<int>x;
    x.resize(n);
    for(auto&m:x)cin>>m;
    vector<map<int,vector<int>>> map_(n+1);
    vector<int> z(1,-1);
    map_.at(0).insert(make_pair(0,z));
    long long intsum=0;
    for(int m=0;m<n;++m){
        for(auto&t:map_.at(m)){
            for(int v=0;v<n;++v){
                vector<int>vec=t.second;
                if(find(vec.begin(),vec.end(),v)==vec.end()||vec.size()==1){
                    vec.pop_back();
                    vec.push_back(v);
                    sort(vec.begin(),vec.end());
                    vec.push_back(-1);
                    bool flag=true;
                    for(auto &c:map_.at(m+1))if(c.second==vec)flag=false;
                    if(flag){
                        for(auto&m:vec)cout<<m<<" ";cout<<m+1<<" "<<t.first+x.at(v)<<endl;
                        map_.at(m+1).insert(make_pair(t.first+x.at(v),vec));
               //     	cout << t.first+x.at(v)<<endl;
                        if((t.first+x.at(v)*1.0)/((m+1)*1.0)==a){
                            ++sum;
                            cout<<"seikai"<<endl;
                        }
                    }
                }
            }
        }
    }
    cout<<sum<<endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:31: error: 'sum' was not declared in this scope
   32 |                             ++sum;
      |                               ^~~
a.cc:40:11: error: 'sum' was not declared in this scope
   40 |     cout<<sum<<endl;
      |           ^~~
Language: C++

#include <map>
#include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <string>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define DEBUG(X) cerr<<"  "<<#X<<" = "<<X<<endl;
#define DUMP(A, n) for (auto x=begin(A); x!=begin(A)+n;x++){cout <<*x<< ' ';} cout<<endl;
#define DUMPP(A, n, m) for (auto x=begin(A); x != begin(A)+n;x++) {for (auto y=begin(*x); y != begin(*x)+m;)cout <<*y++<< ' '; cout<<endl;};
#define DUMPM(M) for (auto itr=mp.begin(); itr!=mp.end(); itr++) {cout<<itr->first<<" -> "<<itr->second<<endl;}
#define FOR(i,x,y) for(int i=(x);i<(int)(y);i++)
#define FORP(i,x,y) for(int i=(x);i<=(int)(y);i++)
#define REP(i,y) for(int i=0;i<(int)(y);i++)
#define REPP(i,y) for(int i=1;i<=(int)(y);i++)
#define RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)

ll n,s;

ll f(ll b, ll n)
{
  if (n >= b)
    return (n%b) + f(b, (ll)(n/b));
  else
    return n;
}

int main() {
  cin >> n >> s;
  ll nr = sqrt(n);
  for(ll b=2;b<=nr;b++)
  {
    ll sum = f(b, n);
    if (sum==s) {
      cout << b << endl;
      return 0;
    }
  }

  if (s==n)
  {
    cout << n+1 << endl;
    return 0;
  }
  if (n<s)
  {
    cout << "-1" << endl;
    return 0;
  }

  for(ll p=1;p<=9;p++)
  {
    ll q = s-p;
    if ((n-q)%p==0&&b=>q&&q>=0) {
      ll b = (n-q)/p;

      cout << b << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:21: error: 'b' was not declared in this scope
   68 |     if ((n-q)%p==0&&b=>q&&q>=0) {
      |                     ^
a.cc:68:23: error: expected primary-expression before '>' token
   68 |     if ((n-q)%p==0&&b=>q&&q>=0) {
      |                       ^
a.cc:69:10: error: redeclaration of 'll b'
   69 |       ll b = (n-q)/p;
      |          ^
a.cc:68:21: note: '<typeprefixerror>b' previously declared here
   68 |     if ((n-q)%p==0&&b=>q&&q>=0) {
      |                     ^
Language: C++

  ll N, A;
  cin >> N >> A;
  vector<ll> x;
  x.pb(0);
  rep(i,N){
    ll inp; cin >> inp;
    x.pb(inp);
  }
 
  rep(i,N)dp[i][0][0]=1;//0枚選んで合計0のやつが全部1通り
 
  for(ll i =1;i<=N;i++){
    for(ll j = 1;j<=N;j++){
      for(ll k = 1;k<=3000;k++){
	if(k<x[i])dp[i][j][k]=dp[i-1][j][k];
	else dp[i][j][k]=dp[i-1][j][k]+dp[i-1][j-1][k-x[i]];
      }	
    }
  }
  ll ans =0;
  rep(i,N+1){
    if (i==0) continue;
    ans += dp[N][i][i*A];
  }
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc:1:3: error: 'll' does not name a type
    1 |   ll N, A;
      |   ^~
a.cc:2:3: error: 'cin' does not name a type
    2 |   cin >> N >> A;
      |   ^~~
a.cc:3:3: error: 'vector' does not name a type
    3 |   vector<ll> x;
      |   ^~~~~~
a.cc:4:3: error: 'x' does not name a type
    4 |   x.pb(0);
      |   ^
a.cc:5:6: error: expected constructor, destructor, or type conversion before '(' token
    5 |   rep(i,N){
      |      ^
a.cc:10:6: error: expected constructor, destructor, or type conversion before '(' token
   10 |   rep(i,N)dp[i][0][0]=1;//0枚選んで合計0のやつが全部1通り
      |      ^
a.cc:12:3: error: expected unqualified-id before 'for'
   12 |   for(ll i =1;i<=N;i++){
      |   ^~~
a.cc:12:15: error: 'i' does not name a type
   12 |   for(ll i =1;i<=N;i++){
      |               ^
a.cc:12:20: error: 'i' does not name a type
   12 |   for(ll i =1;i<=N;i++){
      |                    ^
a.cc:20:3: error: 'll' does not name a type
   20 |   ll ans =0;
      |   ^~
a.cc:21:6: error: expected constructor, destructor, or type conversion before '(' token
   21 |   rep(i,N+1){
      |      ^
a.cc:25:3: error: 'cout' does not name a type
   25 |   cout << ans << endl;
      |   ^~~~
a.cc:27:3: error: expected unqualified-id before 'return'
   27 |   return 0;
      |   ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

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

int main(){

  int n, a;
  ll x[51];
  ll dp[51][51][2501]; // i番目までのカードをj枚使って合計をkになるような選び方

  cin >> n >> a;
  for(int i = 0; i < n; i++) cin >> x[i];
  dp[0][0][0] = 1;
  for(int i = 0; i < n; i++){
    for(int j = 0; j <= i; j++){
      for(int k = 0; k <= n*a; k++){
          dp[i+1][j+1][k+x[i]] += dp[i][j][k];
          dp[i+1][j][k] += dp[i][j][k];
        }
      }
    }
  }
  ll sum = 0;
  for(int i = 1; i <= n; i++){
    sum += dp[n][i][i*a];
  }
  cout << sum << endl;
  return 0;
}


Compiler output:
a.cc:24:3: error: expected unqualified-id before 'for'
   24 |   for(int i = 1; i <= n; i++){
      |   ^~~
a.cc:24:18: error: 'i' does not name a type
   24 |   for(int i = 1; i <= n; i++){
      |                  ^
a.cc:24:26: error: 'i' does not name a type
   24 |   for(int i = 1; i <= n; i++){
      |                          ^
a.cc:27:3: error: 'cout' does not name a type
   27 |   cout << sum << endl;
      |   ^~~~
a.cc:28:3: error: expected unqualified-id before 'return'
   28 |   return 0;
      |   ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

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

typedef long long ll;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

ll n, a, x[50] = {}, dp[51][51][2501] = {};

int main() {
  cin >> n >> a;
  for(int i = 0;i < n;i++){
      cin >> x[i];
  }
  dp[0][0][0] = 1;
  for(int i = 0;i < n;i++){
      for(int j = 0;j < n;j++){
          for(int k = 0;k <= 2500;k++){
              dp[i+1][j][k] += dp[i][j][k];
              if(k-x[i] >= 0)dp[i+1][j+1][k] += dp[i][j][k-x[i]];
          }
      }
  }
  ll ans = 0;
  for(int i = 1;i <= n && i*a <= 2500;i++){
      ans += dp[n][i][i*a];
  }
  cout << ans << endl;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | a#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'a' does not name a type
    1 | a#include <bits/stdc++.h>
      | ^
a.cc: In function 'void initial()':
a.cc:13:3: error: 'cin' was not declared in this scope
   13 |   cin.tie(0);
      |   ^~~
a.cc:14:3: error: 'ios' has not been declared
   14 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc: In function 'int main()':
a.cc:20:3: error: 'cin' was not declared in this scope
   20 |   cin >> n >> a;
      |   ^~~
a.cc:37:3: error: 'cout' was not declared in this scope
   37 |   cout << ans << endl;
      |   ^~~~
a.cc:37:18: error: 'endl' was not declared in this scope
   37 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include <cstdio>
const int MAXN = 51;
const int ZERO = 2550;
const int MAXM = ZERO * 2;
typedef long long LL;
LL F[2][MAXM];
int main() {
	int n, a, i, j, x;
	scanf ( "%d%d", &n, &a );
	F[0][ZERO] = 1;
	for ( i = 1; i <= n; ++i ) {
		scanf ( "%d", &x );
		x -= A;
		for ( j = MAXN; j + MAXN < MAXM; ++j )
			F[i & 1][j] = F[ ( i - 1 ) & 1][j] + F[ ( i - 1 ) & 1][j - x];
	}
	printf ( "%lld\n", F[N & 1][ZERO] - 1 );
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: 'A' was not declared in this scope
   13 |                 x -= A;
      |                      ^
a.cc:17:30: error: 'N' was not declared in this scope
   17 |         printf ( "%lld\n", F[N & 1][ZERO] - 1 );
      |                              ^
Language: C++

#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;

ll dp[2501][55][55]={0};
int main(){
    memset(dp,0,sizeof(dp));
    int n,ave; cin>>n>>ave;
    ll ans=0;
    vi v;
    for(int i=0; i<n;i++){
        int gotiusa; cin>>gotiusa;
        dp[gotiusa][i][1]+=1;
        v.push_back(gotiusa);
    }
    for(int j=0; j<n-1;j++){
        for(int k=1; k<51;k++){
            for(int i=0; i<2501;i++){
                if(!dp[i][j][k])continue;
                dp[i][j+1][k]+=dp[i][j][k];
                dp[i+v[j+1]][j+1][k+1]+=dp[i][j][k];
            }
        }
    }
    for(int i=0; i<2501;i++)
        for(int k=1; k<51;k++){
            if(dp[i][n-1][k]==0)continue;
            else if(i/k==ave&&i%k==0){
                ans+=dp[i][n-1][k];
                //cout<<i<<" "<<k<<endl;
            }
        }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:5: error: 'memset' was not declared in this scope
   47 |     memset(dp,0,sizeof(dp));
      |     ^~~~~~
a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   22 | #include <stack>
  +++ |+#include <cstring>
   23 | #define vi vector<int>
Language: C++

#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;

ll dp[2501][55][55];
int main(){
    memset(dp,0,sizeof(dp));
    int n,ave; cin>>n>>ave;
    ll ans=0;
    vi v;
    for(int i=0; i<n;i++){
        int gotiusa; cin>>gotiusa;
        dp[gotiusa][i][1]+=1;
        v.push_back(gotiusa);
    }
    for(int j=0; j<n-1;j++){
        for(int k=1; k<51;k++){
            for(int i=0; i<2501;i++){
                if(!dp[i][j][k])continue;
                dp[i][j+1][k]+=dp[i][j][k];
                dp[i+v[j+1]][j+1][k+1]+=dp[i][j][k];
            }
        }
    }
    for(int i=0; i<2501;i++)
        for(int k=1; k<51;k++){
            if(dp[i][n-1][k]==0)continue;
            else if(i/k==ave&&i%k==0){
                ans+=dp[i][n-1][k];
                //cout<<i<<" "<<k<<endl;
            }
        }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:5: error: 'memset' was not declared in this scope
   47 |     memset(dp,0,sizeof(dp));
      |     ^~~~~~
a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   22 | #include <stack>
  +++ |+#include <cstring>
   23 | #define vi vector<int>
Language: C++

#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;

int dp[2501][55][55];
int main(){
    memset(dp,0,sizeof(dp));
    int n,ave; cin>>n>>ave;
    ll ans=0;
    vi v;
    for(int i=0; i<n;i++){
        int gotiusa; cin>>gotiusa;
        dp[gotiusa][i][1]+=1;
        v.push_back(gotiusa);
    }
    for(int j=0; j<n-1;j++){
        for(int k=1; k<51;k++){
            for(int i=0; i<2501;i++){
                if(!dp[i][j][k])continue;
                dp[i][j+1][k]+=dp[i][j][k];
                dp[i+v[j+1]][j+1][k+1]+=dp[i][j][k];
            }
        }
    }
    for(int i=0; i<2501;i++)
        for(int k=1; k<51;k++){
            if(dp[i][n-1][k]==0)continue;
            else if(i/k==ave&&i%k==0){
                ans+=dp[i][n-1][k];
                //cout<<i<<" "<<k<<endl;
            }
        }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:5: error: 'memset' was not declared in this scope
   47 |     memset(dp,0,sizeof(dp));
      |     ^~~~~~
a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   22 | #include <stack>
  +++ |+#include <cstring>
   23 | #define vi vector<int>