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

???????????????????????????????????????????????????
??????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????
?????????????????????????????????????????????][?????????????????????????????????????????????
?????????????????????????????????
????????????????????????????????????????????????
?????????????????????
??????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????
?????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
??????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????p?????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???
???
???
?????????????????????????????????????????????????????????????????????????????????
???????????????????????????
???

Compiler output:
a.cc:1:1: error: expected unqualified-id before '?' token
    1 | ???????????????????????????????????????????????????
      | ^
Language: C++

#include<stdio.h>
int main(void) {
	longlong kaz[101][21] = { 0 };
	int n,su[101];
	int i,j;
	scanf("%d", &n);
	for (i = 0;i < n;i++) {
		scanf("%d", &su[i]);
	}
	kaz[0][su[0]]++;
	for (i = 1;i < n - 1;i++) {
		for (j = 0;j < 21;j++) {
			if (kaz[i-1][j] >= 1) {
				if (j + su[i] < 21) {
					kaz[i][j + su[i]] += kaz[i - 1][j];
				}
				if (j - su[i] >= 0) {
					kaz[i][j - su[i]] += kaz[i - 1][j];
				}
			}
		}
	}
	printf("%lld\n", kaz[n - 2][su[n - 1]]);
	for (i = 0;i < n;i++) {
		for (j = 0;j < 21;j++) {
			printf("%lld", kaz[i][j]);
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'longlong' was not declared in this scope
    3 |         longlong kaz[101][21] = { 0 };
      |         ^~~~~~~~
a.cc:10:9: error: 'kaz' was not declared in this scope
   10 |         kaz[0][su[0]]++;
      |         ^~~
Language: C++

#include <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d[100]={0},e,f;
	long long D[100][21]={0};
	cin>>a;
	int Z=0;
	for (b=0;b<a;b++)
	{
		cin>>c;
		d[b]=c;
		if (b==0)
		{
			D[b][c]=1;
		}
		else
		{
			for (e=0;e<21;e++)
			{
				if (D[b-1][e]>0)
				{
					f=e-c;
					if (f>=0)
					{
						D[b][f]+=D[b-1][e];
					}
					f=e+c;
					if (f<=20)
					{
						D[b][f]+=D[b-1][e];
					}
					
				}
				
			}
		}
		
	}
cout<<endl;
}
	cout<<D[a-2][d[a-1]]<<endl;
	return 0;
}
		

Compiler output:
a.cc:42:9: error: 'cout' does not name a type
   42 |         cout<<D[a-2][d[a-1]]<<endl;
      |         ^~~~
a.cc:43:9: error: expected unqualified-id before 'return'
   43 |         return 0;
      |         ^~~~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long int dp[200][200],a,su[200];
int main(){
    cin>>a;
    for(int i=0;i<a;i++){cin>>su[i];}???
    dp[su[0]][0]=1;
    for(int i=0;i<a-1;i++){
        for(int j=0;j<21;j++){
            if(dp[j][i]!=0){
                if(j+su[i+1]>20){}else{ dp[j+su[i+1]][i+1]+=dp[j][i]; }
                if(j-su[i+1]<0){}else{ dp[j-su[i+1]][i+1]+=dp[j][i]; }
                }
            }
        }
    cout<<dp[su[a-1]][a-2]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:38: error: expected primary-expression before '?' token
    6 |     for(int i=0;i<a;i++){cin>>su[i];}???
      |                                      ^
a.cc:6:39: error: expected primary-expression before '?' token
    6 |     for(int i=0;i<a;i++){cin>>su[i];}???
      |                                       ^
a.cc:6:40: error: expected primary-expression before '?' token
    6 |     for(int i=0;i<a;i++){cin>>su[i];}???
      |                                        ^
a.cc:7:19: error: expected ':' before ';' token
    7 |     dp[su[0]][0]=1;
      |                   ^
      |                   :
a.cc:7:19: error: expected primary-expression before ';' token
a.cc:7:19: error: expected ':' before ';' token
    7 |     dp[su[0]][0]=1;
      |                   ^
      |                   :
a.cc:7:19: error: expected primary-expression before ';' token
a.cc:7:19: error: expected ':' before ';' token
    7 |     dp[su[0]][0]=1;
      |                   ^
      |                   :
a.cc:7:19: error: expected primary-expression before ';' token
Language: C++

#include <iostream>
using namespace std;

int main(){
    long long dp[105][21];
    int n,begin,ans,k;
    cin>>n;
    cin>>begin;
    memset(dp, 0, sizeof(dp));
    dp[0][begin]=1;
    for(int i=1; i<n-1; i++){
        cin>>k;
        for(int j=0; j<21; j++){
            if(j+k<=20) dp[i][j+k]+=dp[i-1][j];
            if(j-k>=0) dp[i][j-k]+=dp[i-1][j];
        }
    }
    cin>>ans;
    cout<<dp[n-2][ans]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'memset' was not declared in this scope
    9 |     memset(dp, 0, sizeof(dp));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    long long dp[105][21];
    int n,begin,ans,k;
    cin>>n;
    cin>>begin;
    memset(dp, 0, sizeof(dp));
    dp[0][begin]=1;
    for(int i=1; i<n-1; i++){
        cin>>k;
        for(int j=0; j<21; j++){
            if(j+k<=20) dp[i][j+k]+=dp[i-1][j];
            if(j-k>=0) dp[i][j-k]+=dp[i-1][j];
        }
    }
    cin>>ans;
    cout<<dp[n-2][ans]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'memset' was not declared in this scope
   10 |     memset(dp, 0, sizeof(dp));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
long long int dp[100000][30] = {0};
using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    
    int a[10000]={0};
    for(int i = 0;i < n; i++)scanf("%d",&a[i]);
    
    memset(dp,0,sizeof(dp));
    
    dp[0][a[0]] = 1;
    int v = 0;
    for(int i = 1;i < n-1; i++){
        for(int j = 0;j <= 20; j++){
            if(dp[i-1][j] > 0){
                v = j + a[i];
                if(v <= 20){
                    dp[i][v] += dp[i-1][j];
                }
                v = j-a[i];
                if(v >= 0){
                    dp[i][v] += dp[i-1][j];
                }
            }
        }
    }
    printf("%lld\n",dp[n-2][a[n-1]]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'memset' was not declared in this scope
   12 |     memset(dp,0,sizeof(dp));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | long long int dp[100000][30] = {0};
Language: C++

#include <iostream>
#include <vector>

unsigned long int count=0;
int answer=0;
std::vector<int> number;

void roop(int ans, int num, int fin){
	if((int a=ans+number(num)) <= 20){
		if(num+2!=fin) roop(a, num+1, fin);
		else if(a==answer) ++count;
	} else if((int b=ans-number(num) >=0)){
		if(num+2!=fin) roop(b, num+1, fin);
		else if(b==answer) ++count;
	} else break;
}

int main(){

	int n;
	std::cin >> n;

	for(int i=0;i<n-1;++i){
		std::cin >> number(i);
	}
	std::cin >> answer;

	roop(number(0),1,n);

	std::cout << count << std::endl;

	return 0;
}


Compiler output:
a.cc: In function 'void roop(int, int, int)':
a.cc:9:13: error: expected primary-expression before 'int'
    9 |         if((int a=ans+number(num)) <= 20){
      |             ^~~
a.cc:9:13: error: expected ')' before 'int'
    9 |         if((int a=ans+number(num)) <= 20){
      |            ~^~~
      |             )
a.cc:12:10: error: expected ')' before 'else'
   12 |         } else if((int b=ans-number(num) >=0)){
      |          ^~~~~
      |          )
a.cc:9:11: note: to match this '('
    9 |         if((int a=ans+number(num)) <= 20){
      |           ^
a.cc: In function 'int main()':
a.cc:24:35: error: no match for call to '(std::vector<int>) (int&)'
   24 |                 std::cin >> number(i);
      |                             ~~~~~~^~~
a.cc:28:20: error: no match for call to '(std::vector<int>) (int)'
   28 |         roop(number(0),1,n);
      |              ~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>

unsigned long int count=0;
int answer=0;
std::vector<int> number;

void roop(int ans, int num, int fin){
	if((int a=ans+number(num)) <= 20){
		if(num+2!=fin) roop(a, num+1, fin);
		else if(a==answer) ++count;
	} else if((int b=ans-number(num)) >=0){
		if(num+2!=fin) roop(b, num+1, fin);
		else if(b==answer) ++count;
	} else break;
}

int main(){

	int n;
	std::cin >> n;

	for(int i=0;i<n-1;++i){
		std::cin >> number(i);
	}
	std::cin >> answer;

	roop(number(0),1,n);

	std::cout << count << std::endl;

	return 0;
}


Compiler output:
a.cc: In function 'void roop(int, int, int)':
a.cc:9:13: error: expected primary-expression before 'int'
    9 |         if((int a=ans+number(num)) <= 20){
      |             ^~~
a.cc:9:13: error: expected ')' before 'int'
    9 |         if((int a=ans+number(num)) <= 20){
      |            ~^~~
      |             )
a.cc:12:10: error: expected ')' before 'else'
   12 |         } else if((int b=ans-number(num)) >=0){
      |          ^~~~~
      |          )
a.cc:9:11: note: to match this '('
    9 |         if((int a=ans+number(num)) <= 20){
      |           ^
a.cc: In function 'int main()':
a.cc:24:35: error: no match for call to '(std::vector<int>) (int&)'
   24 |                 std::cin >> number(i);
      |                             ~~~~~~^~~
a.cc:28:20: error: no match for call to '(std::vector<int>) (int)'
   28 |         roop(number(0),1,n);
      |              ~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>

unsigned long int count=0;
int answer=0;

void roop(int ans, vecter<int> number,int num, int fin){
	if((int a=ans+number(num)) <= 20){
		if(num+2!=fin) roop(a, number , num+1, fin);
		else if(a==answer) ++count;
	} else if((int b=ans-number(num)) >=0){
		if(num+2!=fin) roop(b, number, num+1, fin);
		else if(b==answer) ++count;
	} else break;
}

int main(){

	int n;
	std::cin >> n;
	std::vector<int> number(n-1);

	for(int i=0;i<n-1;++i){
		std::cin >> number(i);
	}
	std::cin >> answer;

	roop(number(0),number, 1, n);

	std::cout << count << std::endl;

	return 0;
}


Compiler output:
a.cc:7:20: error: 'vecter' has not been declared
    7 | void roop(int ans, vecter<int> number,int num, int fin){
      |                    ^~~~~~
a.cc:7:26: error: expected ',' or '...' before '<' token
    7 | void roop(int ans, vecter<int> number,int num, int fin){
      |                          ^
a.cc: In function 'void roop(int, int)':
a.cc:8:13: error: expected primary-expression before 'int'
    8 |         if((int a=ans+number(num)) <= 20){
      |             ^~~
a.cc:8:13: error: expected ')' before 'int'
    8 |         if((int a=ans+number(num)) <= 20){
      |            ~^~~
      |             )
a.cc:11:10: error: expected ')' before 'else'
   11 |         } else if((int b=ans-number(num)) >=0){
      |          ^~~~~
      |          )
a.cc:8:11: note: to match this '('
    8 |         if((int a=ans+number(num)) <= 20){
      |           ^
a.cc: In function 'int main()':
a.cc:24:35: error: no match for call to '(std::vector<int>) (int&)'
   24 |                 std::cin >> number(i);
      |                             ~~~~~~^~~
a.cc:28:20: error: no match for call to '(std::vector<int>) (int)'
   28 |         roop(number(0),number, 1, n);
      |              ~~~~~~^~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
typedef pair<int,int> PI;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#define PB push_back

ll dp[21][100];
int n;
num[100];

main(){
  cin>>n;
  rep(i,n)cin>>num[i];
  
  dp[num[0]][0]=1;
  
  for(int i=1;i<n-1;i++){
    rep(j,20){
      int nn=j-num[i];
      if(nn>=0)dp[j][i]+=dp[nn][i-1];
      nn=j+num[i];
      if(nn<21)dp[j][i]+=dp[nn][i-1];
    }
  }
  cout<<dp[num[n-1]][n-2]<<endl;
}

Compiler output:
a.cc:34:1: error: 'num' does not name a type; did you mean 'enum'?
   34 | num[100];
      | ^~~
      | enum
a.cc:36:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   36 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:38:16: error: 'num' was not declared in this scope; did you mean 'enum'?
   38 |   rep(i,n)cin>>num[i];
      |                ^~~
      |                enum
a.cc:40:6: error: 'num' was not declared in this scope; did you mean 'enum'?
   40 |   dp[num[0]][0]=1;
      |      ^~~
      |      enum
Language: C++

#include 
#include 
#include 

using namespace std;

int main(void)
{
    long long hist[100][21];
    int n;
    int form[100];
    
    scanf("%d", &n);
    for (int i = 0; i < n; i++){
        scanf("%d", &form[i]);
    }
    
    memset(hist, 0, sizeof(hist));
    
    hist[0][form[0]] = 1;
    for (int i = 1; i < n - 1; i++){
        for (int j = 0; j < 21; j++){
            if (hist[i - 1][j] > 0){
                if (j - form[i] >= 0 && j - form[i] <= 20) 
                    hist[i][j - form[i]] += hist[i - 1][j];
                if (j + form[i] >= 0 && j + form[i] <= 20)
                    hist[i][j + form[i]] += hist[i - 1][j];
            }
        }
    }
    
    cout << hist[n - 2][form[n - 1]] << endl;
    
    return (0);
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |          ^
a.cc:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include
      |          ^
a.cc:3:10: error: #include expects "FILENAME" or <FILENAME>
    3 | #include
      |          ^
a.cc: In function 'int main()':
a.cc:13:5: error: 'scanf' was not declared in this scope
   13 |     scanf("%d", &n);
      |     ^~~~~
a.cc:18:5: error: 'memset' was not declared in this scope
   18 |     memset(hist, 0, sizeof(hist));
      |     ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | #include
a.cc:32:5: error: 'cout' was not declared in this scope
   32 |     cout << hist[n - 2][form[n - 1]] << endl;
      |     ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include
a.cc:32:41: error: 'endl' was not declared in this scope
   32 |     cout << hist[n - 2][form[n - 1]] << endl;
      |                                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include
Language: C++

a,d;int main(b){long long int t[21][2];for(scanf("%d%d",&a,&b);d<21;d++)t[d][a&1]=!(b-d);for(;--a-1&&scanf("%d",&b);)for(d=0;d<21;t[d++][a&1]=((b>d?0:t[d-b][!(a&1)])+((b<(21-d))?t[b+d][!(a&1)]:0)));scanf("%d",&b),printf("%lld",t[b][0]);}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,d;int main(b){long long int t[21][2];for(scanf("%d%d",&a,&b);d<21;d++)t[d][a&1]=!(b-d);for(;--a-1&&scanf("%d",&b);)for(d=0;d<21;t[d++][a&1]=((b>d?0:t[d-b][!(a&1)])+((b<(21-d))?t[b+d][!(a&1)]:0)));scanf("%d",&b),printf("%lld",t[b][0]);}
      | ^
a.cc:1:9: error: cannot declare '::main' to be a global variable
    1 | a,d;int main(b){long long int t[21][2];for(scanf("%d%d",&a,&b);d<21;d++)t[d][a&1]=!(b-d);for(;--a-1&&scanf("%d",&b);)for(d=0;d<21;t[d++][a&1]=((b>d?0:t[d-b][!(a&1)])+((b<(21-d))?t[b+d][!(a&1)]:0)));scanf("%d",&b),printf("%lld",t[b][0]);}
      |         ^~~~
a.cc:1:14: error: 'b' was not declared in this scope
    1 | a,d;int main(b){long long int t[21][2];for(scanf("%d%d",&a,&b);d<21;d++)t[d][a&1]=!(b-d);for(;--a-1&&scanf("%d",&b);)for(d=0;d<21;t[d++][a&1]=((b>d?0:t[d-b][!(a&1)])+((b<(21-d))?t[b+d][!(a&1)]:0)));scanf("%d",&b),printf("%lld",t[b][0]);}
      |              ^
Language: C++


#include<cstdio>
#include<cstring>
int main(){
	int table[100][21],N,a;
	memset(table,0,sizeof(table));
	scanf("%d",&N);
	scanf("%d",&a);
	table[0][a]=1;
	for(int i=1;i<N-1;i++){
		scanf("%d",&a);
		for(int j=0;j<=21;j++){
			if(j+i<=21)table[i][j]+=table[j+i];
			if(j-i<=21)table[i][j]+=table[j-i];
		}		
	}
	scanf("%d",&a);
	printf("%d\n",table[N-2][a]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:47: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   13 |                         if(j+i<=21)table[i][j]+=table[j+i];
      |                                    ~~~~~~~~~~~^~~~~~~~~~~~
      |                                               |
      |                                               int*
a.cc:14:47: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   14 |                         if(j-i<=21)table[i][j]+=table[j-i];
      |                                    ~~~~~~~~~~~^~~~~~~~~~~~
      |                                               |
      |                                               int*
Language: C++

vector<int> nums;
ll dp[110][25];
ll dfs(int n, int sum){
	ll result = 0;
	if(sum < 0 || sum > 20) return 0;
	if(dp[n][sum] >= 0) return dp[n][sum];
	if(n == nums.size() - 1) {
		if(nums[n] == sum) return 1;
	}
	result = dfs(n+1,sum + nums[n]) + dfs(n+1,sum - nums[n]);
	return dp[n][sum] = result;
}
int main(){
	int N;
	rep(i,110)rep(j,25){
		dp[i][j] = -1;
	}
	cin >> N;
	rep(i,N){
		int a;
		cin >> a;
		nums.pb(a);
	}
	cout << dfs(0,0);
	return 0;
}

Compiler output:
a.cc:1:1: error: 'vector' does not name a type
    1 | vector<int> nums;
      | ^~~~~~
a.cc:2:1: error: 'll' does not name a type
    2 | ll dp[110][25];
      | ^~
a.cc:3:1: error: 'll' does not name a type
    3 | ll dfs(int n, int sum){
      | ^~
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         rep(i,110)rep(j,25){
      |             ^
a.cc:15:9: error: 'rep' was not declared in this scope
   15 |         rep(i,110)rep(j,25){
      |         ^~~
a.cc:18:9: error: 'cin' was not declared in this scope
   18 |         cin >> N;
      |         ^~~
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << dfs(0,0);
      |         ^~~~
a.cc:24:17: error: 'dfs' was not declared in this scope
   24 |         cout << dfs(0,0);
      |                 ^~~
Language: C++

//情報オリンピック2010予選問４「一年生」#include<stdio.h> long long c[21]; void ck(int, int[], int); int main(void){     int n, f1, j[100];    long long out;     scanf("%d",&n);     for(f1 = 0; f1 < n; f1++)        scanf("%d",&j[f1]);     for(f1 = 0; f1 < 21; f1++)        c[f1] = 0;     c[ j[0] ] = 1;     ck(n, j, 1);     out = c[ j[n-1] ];     printf("%lld",out);     return 0;}void ck(int s1, int l[100], int cnt){     int fs1, wa, sa;    long long cl2[21];     if(cnt < s1-2){         for(fs1 = 0; fs1 < 21; fs1++)            cl2[fs1] = 0;         for(fs1 = 0; fs1 < 21; fs1++){            if(c[fs1] > 0){                wa = fs1 + l[cnt];                sa = fs1 - l[cnt];                if(wa <= 20)                    cl2[wa] += c[fs1];                                 if(sa >= 0)                    cl2[sa] += c[fs1];            }        }         for(fs1 = 0; fs1 < 21; fs1++)            c[fs1] = cl2[fs1];         ck(s1,l,cnt+1);    }}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

unsigned long long int dp[101][21];

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

	dp[0][0] = 1;

	for(int i=1; i<n; ++i){
		for(int j=0; j<21; ++j){
			if(j-a[i] >= 0){
				dp[i][j] += dp[i-1][j-a[i]];
			if(j+a[i] <= 20){
				dp[i][j] += dp[i-1][j+a[i]];
			}

			if(i == 0 && a[i] == 0) dp[i][j] = dp[i-1][j];
		}
	}

	cout << dp[n-1][a[n]] << endl;


    return 0;
}

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

#include <iostream>

using namespace std;
typedef long long ll;

int main(){
  int n, s, r;
  
  cin >> n;

  ll dp[101][40];
  memset(dp, 0, sizeof(dp));
  dp[0][9] = 1;

  for(int i = 1; i < n; i++){
    cin >> s;
    
    for(int j = 9; j <= 29; j++){
      if(dp[i-1][j] != 0){
        dp[i][j+s] += dp[i-1][j];
        dp[i][j-s] += dp[i-1][j];
      }
    }
  }

  cin >> r;

  cout << dp[n-1][r+9] << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'memset' was not declared in this scope
   12 |   memset(dp, 0, sizeof(dp));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <iostream>

using namespace std;

int dp[101][21];

int main(void){

  int n;
  cin >> n;
  int num[101];
  for( int i = 0 ; i < n ; i++ ){
    cin >> num[i];
  }

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

  for( int j = 1 ; j < n ; j++ ){
    for( int i = 0 ; i < 21 ; i++ ){
      if( i + num[j] <= 20 )
	dp[j][i + num[j]] += dp[j][i];
      if( i - num[j] >= 0 )
	dp[j][i - num[j]] += dp[j][[i];
    }
  }
    cout << dp[n - 2][num[n - 1]] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:35: error: two consecutive '[' shall only introduce an attribute before '[' token
   23 |         dp[j][i - num[j]] += dp[j][[i];
      |                                   ^
Language: C++

//線形探索やら範囲探索？やらすると、計算量が半端ない。正解の解の数自体が多すぎるので、限定もしづらい。
//N回目に符号をつける数は、どのパターンでも一緒であるので、
//N-1回目までに演算して出てきた値が同じのものは、N回目の演算における結果が一致する。
//結果のバリエーションが少なく、結果が同じものはその前に依存せず、次の結果も同じになる。
//よって、結果によって処理をまとめておこなう、動的計画法とやらが使えそう。
#include<stdio.h>

int main(){
	FILE *fp1,*fp2;
	int num;
	int i,j,d,ans;
	long long data[99][21] = {0};	//data[i][j]には、i回目の演算でjという値がでる場合の数を保存.
													
	fp1 = fopen("input.txt","r");
	fp2 = fopen("output.txt","w");
	fscanf(fp1,"%d",&num);
	fscanf(fp1,"%d",&d);		//最初の数字は0以上20以下である。
	data[0][d] = 1;
	for(i = 1;i < num-1;i++){
		fscanf("%d",&d);
		for(j = 0;j < 21;j++){
			if(j+d <= 20)
				data[i][j+d] = data[i-1][j]
			if(j-d >= 0)
				data[i][j-d] = data[i-1][j]
		}
	}
	fscanf(fp1,"%d",&ans);
	fprintf(fp2,"%I64d",data[98][ans]);
	fclose(fp1);
	fclose(fp2);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: cannot convert 'const char*' to 'FILE*'
   20 |                 fscanf("%d",&d);
      |                        ^~~~
      |                        |
      |                        const char*
In file included from a.cc:6:
/usr/include/stdio.h:422:37: note:   initializing argument 1 of 'int fscanf(FILE*, const char*, ...)'
  422 | extern int fscanf (FILE *__restrict __stream,
      |                    ~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:23:60: error: expected ';' before 'if'
   23 |                                 data[i][j+d] = data[i-1][j]
      |                                                            ^
      |                                                            ;
   24 |                         if(j-d >= 0)
      |                         ~~
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
long number[101];
long numbers[101][21][50];
int N;
int last;
long canNumber(long numbers[],int value,int time ){
  int n=value;
  long sum=0;
  if(time==N-1){
    if(value==last ){
    return 1;
  }
  return 0;
  }
    
  if(value>=0 && value<=20 ){
    sum+=canNumber(numbers,n+numbers[time+1],time+1);
    sum+=canNumber(numbers,n-numbers[time+1],time+1);
  }
  cout << sum << endl;
  return sum;
}

int main(void){

   
  cin >> N;
  N-=1;
  for (int i=0;i<N;i++){
    cin >> number[i];
  }
  cin >> last;
  numbers[0][number[0]][0]=1;
  for(int k=0;k<50;k++){
    for(int i=1;i<N;i++){
      for(int j=0;j<=20;j++){
	if(j+number[i]>=0 && j+number[i] <=20 && numbers[i-1][j][k]!=0){
	  numbers[i][j+number[i]][k]+=numbers[i-1][j][k]%1000000;
	  numbers[i][j+number[i]][k+1]+=numbers[i-1][j][k]/1000000;
	  // cout << i <<" " << j+number[i]<<" "<< j << " " <<numbers[i-1][j][k]<< endl;
	}
	if(j-number[i]>=0 && j-number[i] <=20 && numbers[i-1][j][k]!=0){
	  numbers[i][j-number[i]][k]+=numbers[i-1][j][k]%1000000;
	  numbers[i][j-number[i]][k+1]+=numbers[i-1][j][k]/1000000;
	  // cout << i <<" " << j-number[i]<<" "<< j << " " <<numbers[i-1][j][k]<< endl;
	}
      }
    }
  }
  for(int k=50;k>=0;k--){

    if(numbers[N-1][last][k]!=0){

      cout << (numbers[N-1][last][k]%1000000)+(numbers[N-1][last][k-1]/1000000);
	if(numbers[N-1][last][k-1]%1000000<pow(10,5) && k!=0)// && k-1==0)
	  {
	  	cout << 0 ;
      
	  }
      
      
    }

    }
  cout<<endl;

  return 0;

}
}

Compiler output:
a.cc:72:1: error: expected declaration before '}' token
   72 | }
      | ^
Language: C++

#include<iostream>

using namespace std;
long number[101];
long numbers[101][21][50];
int N;
int last;
long canNumber(long numbers[],int value,int time ){
  int n=value;
  long sum=0;
  if(time==N-1){
    if(value==last ){
    return 1;
  }
  return 0;
  }
    
  if(value>=0 && value<=20 ){
    sum+=canNumber(numbers,n+numbers[time+1],time+1);
    sum+=canNumber(numbers,n-numbers[time+1],time+1);
  }
  cout << sum << endl;
  return sum;
}

int main(void){

   
  cin >> N;
  N-=1;
  for (int i=0;i<N;i++){
    cin >> number[i];
  }
  cin >> last;
  numbers[0][number[0]][0]=1;
  for(int k=0;k<50;k++){
    for(int i=1;i<N;i++){
      for(int j=0;j<=20;j++){
	if(j+number[i]>=0 && j+number[i] <=20 && numbers[i-1][j][k]!=0){
	  numbers[i][j+number[i]][k]+=numbers[i-1][j][k]%1000000;
	  numbers[i][j+number[i]][k+1]+=numbers[i-1][j][k]/1000000;
	  // cout << i <<" " << j+number[i]<<" "<< j << " " <<numbers[i-1][j][k]<< endl;
	}
	if(j-number[i]>=0 && j-number[i] <=20 && numbers[i-1][j][k]!=0){
	  numbers[i][j-number[i]][k]+=numbers[i-1][j][k]%1000000;
	  numbers[i][j-number[i]][k+1]+=numbers[i-1][j][k]/1000000;
	  // cout << i <<" " << j-number[i]<<" "<< j << " " <<numbers[i-1][j][k]<< endl;
	}
      }
    }
  }
  for(int k=50;k>=0;k--){

    if(numbers[N-1][last][k]!=0){

      cout << (numbers[N-1][last][k]%1000000)+(numbers[N-1][last][k-1]/1000000);
	if(numbers[N-1][last][k-1]%1000000<10000 && k!=0)// && k-1==0)
	  {
	  	cout << 0 ;
      
	  }
      
      
    }

    }
  cout<<endl;

  return 0;

}
}

Compiler output:
a.cc:72:1: error: expected declaration before '}' token
   72 | }
      | ^
Language: C++

#include <stdio.h>

long long int main(){
	long long int resultcalc, result;
	long long int dp[101][21] = {0};
	int plus[100] = {0};
	int number, i, j, k;
	scanf("%d", &number);
	for(i = 1;i <= number - 1;i++){
		scanf("%d ", &plus[i]);
	}
	scanf("%d", &resultcalc);
	dp[0][0] = 1;
	for(j = 1;j < number;j++){
		for(k = 0;k <= 20;k++){
			if(dp[j - 1][k] > 0){
				if(k + plus[j] <= 20)dp[j][k + plus[j]] += dp[j - 1][k];
				if(k - plus[j] >= 0)dp[j][k - plus[j]] += dp[j - 1][k];
			}
		}
	}
	result = dp[number - 1][resultcalc];
	printf("%lld\n", result);
	
	return 0;
}

Compiler output:
a.cc:3:11: error: '::main' must return 'int'
    3 | long long int main(){
      |           ^~~
Language: C++

#include<iostream>

int n;
int v[101];
long long dp[101][21];

long long calc(int i,int j){
	if(j>20||j<0)return 0;
	if(dp[i][j]!=-1)return dp[i][j];
	if(i==n-1&&j==v[n-1])return 1;
	else if(i==n-1&&j!=v[n-1])return 0;

	long long ans=0;
	ans+=calc(i+1,j+v[i]);
	ans+=calc(i+1,j-v[i]);
	return dp[i][j]=ans;
}

int main(){
	memset(dp,-1,sizeof(dp));
	std::cin>>n;
	for(int i=0;i<n;i++)std::cin>>v[i];
	std::cout<<calc(1,v[0])<<std::endl;;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'memset' was not declared in this scope
   20 |         memset(dp,-1,sizeof(dp));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for( int i = 0; i < n; i++ )
typedef vector<int> vec;

int main(){
    int n;
    cin >> n;
    vec fml(n);
    rep(i, n){
        cin >> fml[i];
    }
    long long int dp[101][21];
    memset( dp, 0, sizeof(dp) );
    dp[1][fml[0]] = 1;
    rep(i, n-1){
        rep(j, 21){
            if( dp[i][j] > 0 ){
                int plus = j + fml[i];
                int minus = j - fml[i];
                if( plus <= 20 ) dp[i+1][plus] += dp[i][j];
                if( minus >= 0 ) dp[i+1][minus] += dp[i][j];
            }
        }
    }
    cout << dp[n-1][fml[n-1]] << endl;
}

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

#include <iostream>
#include <vector>
#include <string>
using namespace std;
#define rep(i, n) for( int i = 0; i < n; i++ )
typedef vector<int> vec;

int main(){
    int n;
    cin >> n;
    vec fml(n);
    rep(i, n){
        cin >> fml[i];
    }
    long long int dp[101][21];
    memset( dp, 0, sizeof(dp) );
    dp[1][fml[0]] = 1;
    rep(i, n-1){
        rep(j, 21){
            if( dp[i][j] > 0 ){
                int plus = j + fml[i];
                int minus = j - fml[i];
                if( plus <= 20 ) dp[i+1][plus] += dp[i][j];
                if( minus >= 0 ) dp[i+1][minus] += dp[i][j];
            }
        }
    }
    cout << dp[n-1][fml[n-1]] << endl;
}

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

#include <iostream>
#include <vector>
#include <string>
using namespace std;
#define rep(i, n) for( int i = 0; i < n; i++ )
typedef vector<int> vec;

int main(){
    int n;
    cin >> n;
    vec fml(n);
    rep(i, n){
        int num;
        cin >> num;
        fml[i] = num;
    }
    long long int dp[101][21];
    memset( dp, 0, sizeof(dp) );
    dp[1][fml[0]] = 1;
    rep(i, n-1){
        rep(j, 21){
            if( dp[i][j] > 0 ){
                int plus = j + fml[i];
                int minus = j - fml[i];
                if( plus <= 20 ) dp[i+1][plus] += dp[i][j];
                if( minus >= 0 ) dp[i+1][minus] += dp[i][j];
            }
        }
    }
    cout << dp[n-1][fml[n-1]] << endl;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <cstdio>
using namespace std;
#define rep(i, n) for( int i = 0; i < n; i++ )
typedef vector<int> vec;

int main(){
    int n;
    cin >> n;
    vec fml(n);
    rep(i, n){
        cin >> fml[i];
    }
    long long int dp[101][21];
    memset( dp, 0, sizeof(dp) );
    dp[1][fml[0]] = 1;
    rep(i, n-1){
        rep(j, 21){
            if( dp[i][j] > 0 ){
                int plus = j + fml[i];
                int minus = j - fml[i];
                if( plus <= 20 ) dp[i+1][plus] += dp[i][j];
                if( minus >= 0 ) dp[i+1][minus] += dp[i][j];
            }
        }
    }
    cout << dp[n-1][fml[n-1]] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'memset' was not declared in this scope
   17 |     memset( dp, 0, sizeof(dp) );
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdio>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include<iostream>

using namespace std;

#define MAX	110

long long int DP[MAX][MAX];
int target;
int input[MAX];
int n;
int dfs_end;


long long int dfs(int now , int sum)
{
	if (now == dfs_end)
	{
		if (sum == target)
		{
			return 1;
		}
		return 0;
	}
	if (sum > 20 || 0 > sum)
	{
		return 0;
	}
	if (DP[now][sum] != 0)
	{
		return DP[now][sum];
	}
	DP[now][sum] += dfs(now + 1 , sum + input[now]);
	DP[now][sum] += dfs(now + 1 , sum - input[now]);

}



int main()
{
	cin >> n;
	memset(DP , 0 , sizeof(DP));

	for (int i = 0; i < n; i++)
	{
		cin >> input[i];
	}

	target = input[n - 1];
	dfs_end = n - 1;

	dfs(0 , 0);
	
	cout << DP[0][0] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'memset' was not declared in this scope
   42 |         memset(DP , 0 , sizeof(DP));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | 
a.cc: In function 'long long int dfs(int, int)':
a.cc:33:22: warning: control reaches end of non-void function [-Wreturn-type]
   33 |         DP[now][sum] += dfs(now + 1 , sum - input[now]);
      |         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;
typedef long long Int;

Int dp[105][25];

int main(){
 cin >> n;
 for(int i = 0;i < n - 1;i++)cin >> num[i];
 cin >> ans;
 dp[0][num[0]] = 1;
 for(int i = 1;i < n - 1;i++){
  for(int j = 0;j < 20;j++){
   if(j - num[i] >= 0)dp[i][j] += dp[i - 1][j - num[i]];
   if(j + num[i] <= 20)dp[i][j] += dp[i - 1][j + num[i]];
  }
 }
 cout << dp[n - 1][ans] << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'n' was not declared in this scope
   10 |  cin >> n;
      |         ^
a.cc:11:37: error: 'num' was not declared in this scope; did you mean 'enum'?
   11 |  for(int i = 0;i < n - 1;i++)cin >> num[i];
      |                                     ^~~
      |                                     enum
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |  cin >> ans;
      |         ^~~
      |         abs
a.cc:13:8: error: 'num' was not declared in this scope; did you mean 'enum'?
   13 |  dp[0][num[0]] = 1;
      |        ^~~
      |        enum
Language: C++

#include<iostream>#include<string>using namespace std;long long dp[100][21];int N, num[100];long long dfs(int i, int v){  if(dp[i][v] != -1)    return dp[i][v];  if(i == N - 1)    return v == num[N - 1] ? 1 : 0;  int plus = v   num[i];  int minus = v - num[i];  long long n = 0;  if(plus >= 0 

Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include<iostream>#include<string>using namespace std;long long dp[100][21];int N, num[100];long long dfs(int i, int v){  if(dp[i][v] != -1)    return dp[i][v];  if(i == N - 1)    return v == num[N - 1] ? 1 : 0;  int plus = v   num[i];  int minus = v - num[i];  long long n = 0;  if(plus >= 0
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++


#include<iostream>
#include<string>
using namespace std;

long long dp[100][21];
int N, num[100];

long long dfs(int i, int v)
{
  if(dp[i][v] != -1)
    return dp[i][v];
  if(i == N - 1)
    return v == num[N - 1] ? 1 : 0;
  int plus = v   num[i];
  int minus = v - num[i];
  long long n = 0;
  if(plus >= 0 

Compiler output:
a.cc: In function 'long long int dfs(int, int)':
a.cc:15:18: error: expected ',' or ';' before 'num'
   15 |   int plus = v   num[i];
      |                  ^~~
a.cc:18:15: error: expected ')' at end of input
   18 |   if(plus >= 0
      |     ~         ^
      |               )
a.cc:18:15: error: expected statement at end of input
a.cc:18:15: error: expected '}' at end of input
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
a.cc:18:15: warning: control reaches end of non-void function [-Wreturn-type]
   18 |   if(plus >= 0
      |               ^
Language: C++


#include<iostream>
#include<string>
using namespace std;

long long dp[100][21];
int N, num[100];

long long dfs(int i, int v)
{
  if(dp[i][v] != -1)
    return dp[i][v];
  if(i == N - 1)
    return v == num[N - 1] ? 1 : 0;
  int plus = v   num[i];
  int minus = v - num[i];
  long long n = 0;
  if(plus >= 0 \

Compiler output:
a.cc:18:16: error: stray '\' in program
   18 |   if(plus >= 0 \
      |                ^
a.cc: In function 'long long int dfs(int, int)':
a.cc:15:18: error: expected ',' or ';' before 'num'
   15 |   int plus = v   num[i];
      |                  ^~~
a.cc:18:15: error: expected ')' at end of input
   18 |   if(plus >= 0 \
      |     ~         ^
      |               )
a.cc:18:15: error: expected statement at end of input
a.cc:18:15: error: expected '}' at end of input
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
a.cc:18:15: warning: control reaches end of non-void function [-Wreturn-type]
   18 |   if(plus >= 0 \
      |               ^
Language: C++


#include<iostream>
#include<string>
using namespace std;

long long dp[100][21];
int N, num[100];

long long dfs(int i, int v)
{
  if(dp[i][v] != -1)
    return dp[i][v];
  if(i == N - 1)
    return v == num[N - 1] ? 1 : 0;
  int plus = v   num[i];
  int minus = v - num[i];
  long long n = 0;
  if(plus >= 0 && plus <= 20)
    n  = dfs(i   1, plus);
  if(minus >= 0 && minus <= 20)
    n  = dfs(i   1, minus);
  dp[i][v] = n;
  return n;
}

int main()
{
  for(int i = 0; i < 100; i  )
    for(int j = 0; j < 21; j  )
      dp[i][j] = -1;
  cin >> N;
  for(int i = 0; i < N; i  )
    cin >> num[i];
  cout << dfs(0, 0) << endl;
}

Compiler output:
a.cc: In function 'long long int dfs(int, int)':
a.cc:15:18: error: expected ',' or ';' before 'num'
   15 |   int plus = v   num[i];
      |                  ^~~
a.cc:19:15: error: expected ')' before numeric constant
   19 |     n  = dfs(i   1, plus);
      |             ~ ^  ~
      |               )
a.cc:21:15: error: expected ')' before numeric constant
   21 |     n  = dfs(i   1, minus);
      |             ~ ^  ~
      |               )
Language: C++


=23include=3Ciostream=3E
=23include=3Cstring=3E
using=20namespace=20std=3B

long=20long=20dp=5B100=5D=5B21=5D=3B
int=20N=2C=20num=5B100=5D=3B

long=20long=20dfs=28int=20i=2C=20int=20v=29
=7B
=20=20if=28dp=5Bi=5D=5Bv=5D=20=21=3D=20=2D1=29
=20=20=20=20return=20dp=5Bi=5D=5Bv=5D=3B
=20=20if=28i=20=3D=3D=20N=20=2D=201=29
=20=20=20=20return=20v=20=3D=3D=20num=5BN=20=2D=201=5D=20=3F=201=20=3A=20=
0=3B
=20=20int=20plus=20=3D=20v=20=2B=20num=5Bi=5D=3B
=20=20int=20minus=20=3D=20v=20=2D=20num=5Bi=5D=3B
=20=20long=20long=20n=20=3D=200=3B
=20=20if=28plus=20=3E=3D=200=20=26=26=20plus=20=3C=3D=2020=29
=20=20=20=20n=20=2B=3D=20dfs=28i=20=2B=201=2C=20plus=29=3B
=20=20if=28minus=20=3E=3D=200=20=26=26=20minus=20=3C=3D=2020=29
=20=20=20=20n=20=2B=3D=20dfs=28i=20=2B=201=2C=20minus=29=3B
=20=20dp=5Bi=5D=5Bv=5D=20=3D=20n=3B
=20=20return=20n=3B
=7D

int=20main=28=29
=7B
=20=20for=28int=20i=20=3D=200=3B=20i=20=3C=20100=3B=20i=2B=2B=29
=20=20=20=20for=28int=20j=20=3D=200=3B=20j=20=3C=2021=3B=20j=2B=2B=29
=20=20=20=20=20=20dp=5Bi=5D=5Bj=5D=20=3D=20=2D1=3B
=20=20cin=20=3E=3E=20N=3B
=20=20for=28int=20i=20=3D=200=3B=20i=20=3C=20N=3B=20i=2B=2B=29
=20=20=20=20cin=20=3E=3E=20num=5Bi=5D=3B
=20=20cout=20=3C=3C=20dfs=280=2C=200=29=20=3C=3C=20endl=3B
=7D

Compiler output:
a.cc:2:23: error: exponent has no digits
    2 | =23include=3Ciostream=3E
      |                       ^~
a.cc:3:21: error: exponent has no digits
    3 | =23include=3Cstring=3E
      |                     ^~
a.cc:19:20: error: exponent has no digits
   19 | =20=20if=28plus=20=3E=3D=200=20=26=26=20plus=20=3C=3D=2020=29
      |                    ^~
a.cc:21:21: error: exponent has no digits
   21 | =20=20if=28minus=20=3E=3D=200=20=26=26=20minus=20=3C=3D=2020=29
      |                     ^~
a.cc:32:14: error: exponent has no digits
   32 | =20=20cin=20=3E=3E=20N=3B
      |              ^~
a.cc:32:17: error: exponent has no digits
   32 | =20=20cin=20=3E=3E=20N=3B
      |                 ^~
a.cc:34:20: error: exponent has no digits
   34 | =20=20=20=20cin=20=3E=3E=20num=5Bi=5D=3B
      |                    ^~
a.cc:34:23: error: exponent has no digits
   34 | =20=20=20=20cin=20=3E=3E=20num=5Bi=5D=3B
      |                       ^~
a.cc:35:50: error: exponent has no digits
   35 | =20=20cout=20=3C=3C=20dfs=280=2C=200=29=20=3C=3C=20endl=3B
      |                                                  ^~~~~~
a.cc:2:1: error: expected unqualified-id before '=' token
    2 | =23include=3Ciostream=3E
      | ^
Language: C++


#include<iostream>
#include<string>
using namespace std;

long long dp[100][21];
int N, num[100];

long long dfs(int i, int v)
{
  if(dp[i][v] != -1)
    return dp[i][v];
  if(i == N - 1)
    return v == num[N - 1] ? 1 : 0;
  int plus = v \  num[i];
  int minus = v - num[i];
  long long n = 0;
  if(plus >= 0 \

Compiler output:
a.cc:15:16: error: stray '\' in program
   15 |   int plus = v \  num[i];
      |                ^
a.cc:18:16: error: stray '\' in program
   18 |   if(plus >= 0 \
      |                ^
a.cc: In function 'long long int dfs(int, int)':
a.cc:15:19: error: expected ',' or ';' before 'num'
   15 |   int plus = v \  num[i];
      |                   ^~~
a.cc:18:15: error: expected ')' at end of input
   18 |   if(plus >= 0 \
      |     ~         ^
      |               )
a.cc:18:15: error: expected statement at end of input
a.cc:18:15: error: expected '}' at end of input
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
a.cc:18:15: warning: control reaches end of non-void function [-Wreturn-type]
   18 |   if(plus >= 0 \
      |               ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;
int n,d[101];
ll dp[101][21];

int main(){
  cin >> n;
  for(int i = 0;i < n;i++) cin >> d[i];
  
  memset(dp,0,sizeof(dp)); dp[0][d[0]] = 1;
  for(int i = 0;i < n - 1;i++){
    for(int j = 0;j <= 20;j++){
      if(j + d[i] <= 20) dp[i + 1][j + d[i]] += dp[i][j];
      if(j - d[i] >= 0) dp[i + 1][j - d[i]] += dp[i][j];
    }
  }
  
  cout << dp[n-2][d[n-1]] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'memset' was not declared in this scope
   13 |   memset(dp,0,sizeof(dp)); dp[0][d[0]] = 1;
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

typedef vector<int> vi;
typedef unsigned long long ull;
#define rep(i,a) for(int i=0; i<int(a); i++)

int n;
int a[100];
int s;
ull dp[2][25];

ull solve(){
    memset(dp, 0, sizeof(dp));
    ull *cur = dp[0], *prev = dp[1];
    prev[0] = 1;
    rep(i, n){
        memset(cur, 0, sizeof(dp)/2);
        rep(j, 20 + 1){
            int t1 = j + a[i];
            int t2 = j - a[i];
            if (0 <= t1 && t1 <= 20){
                cur[t1] += prev[j];
            }
            if (0 <= t2 && t2 <= 20){
                cur[t2] += prev[j];
            }
        }
        //rep(i, 21) cout << cur[i] << " ";
        //cout << endl;
        swap(cur, prev);
    }

    return prev[s];
}

int main(){
    while (cin >> n){
        n--;
        rep(i, n) cin >> a[i];
        cin >> s;
        cout << solve() << endl;
    }
}

Compiler output:
a.cc: In function 'ull solve()':
a.cc:16:5: error: 'memset' was not declared in this scope
   16 |     memset(dp, 0, sizeof(dp));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 |
Language: C++

#include<iostream>

int num[101];
int n;
long long memo[21][101];

long long calc(int sum, int cnt){
	long long res = 0;

	if (sum < 0 || sum > 20)return 0;
	if (cnt == n - 1){
		if (sum == num[n - 1])return memo[sum][cnt] = 1;
		return 0;
	}

	if (memo[sum][cnt])return memo[sum][cnt];


	res += calc(sum + num[cnt], cnt + 1);
	res += calc(sum - num[cnt], cnt + 1);

	return memo[sum][cnt] = res;
}

int main(){

	std::cin >> n;
	for (int i = 0; i < n; i++)std::cin >> num[i];

	memset(memo, 0, sizeof(memo));

	std::cout << calc(0, 0) << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'memset' was not declared in this scope
   30 |         memset(memo, 0, sizeof(memo));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <iostream>
#include <array>
#include <fstream>

int main(){
    const int max_sum = 20;
    const int min_sum = 0;
    const int max_number = 100;
    int N;
    //std::ifstream ifs("517.txt");
    
    //while(std::cin >> N){
    std::cin >> N;
        std::array<int, max_number> numbers;
        std::array<std::array<long long int, max_sum + 1>, max_number> count;
        for(int i = 0; i < max_number; ++i){
            count[i].fill(0);
        }
        for(int i = 0; i < N; ++i){
            syd::cin /*ifs*/ >> numbers[i];
        }
        
        count[0][numbers[0]] = 1;
        for(int i = 1; i < N; ++i){
            for(int j = 0; j <= max_sum; ++j){
                if(j + numbers[i] <= max_sum){
                    count[i][j + numbers[i]] += count[i - 1][j];
                }
                if(j - numbers[i] >= min_sum){
                    count[i][j - numbers[i]] += count[i - 1][j];
                }
            }
        }
        std::cout << count[N - 2][numbers[N - 1]] << std::endl;
   // }
    
    //ifs.close();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'syd' has not been declared
   20 |             syd::cin /*ifs*/ >> numbers[i];
      |             ^~~
Language: C++

#include <iostream>
#include <vector>

int main(){
	int num;
	std::vector< std::vector<int> > dp(num, std::vector<int>(21,0));
	std::cin >> num;
	std::vector<int> value(num);
	for(int i = 0; i < n; ++i){
		std::cin >> value[i];
	}
	dp[0][0] = 1;
	for(int i = 0; i < (value.size() - 1); ++i){
		for(int j = 0; j <= 20; ++j){
			if((j + value.at(i)) <= 20){
				dp[i + 1][j] += dp[i][j + value.at(i)];
			}
			if((j - value.at(i)) >= 0){
				dp[i + 1][j] += dp[i][j - value.at(i)];
			}
		}
	}
	std::cout << dp[value.size() - 1][value.at(num - 1)] << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: 'n' was not declared in this scope
    9 |         for(int i = 0; i < n; ++i){
      |                            ^