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

#include<stdio.h>

int n,A[50];


int solve (int i,int m){
	if (m==0){
		return 1;
	}
	if (i>=n){
		return 0;
	}
	int res = solve(i+1,m) || solve(i+1,m-A[i]);
	return res;
}

int main(){
	int q,M,i;

	scanf("%d",&n);
	for(i=0,i<n;i++){
		scanf("%d",&A[i]);
	}
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d",&M);
		if(solve(0,M)) {
			printf("yes\n");
		}else{
			printf("no\n");
		}
	}
	
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:21:24: error: expected ';' before ')' token
   21 |         for(i=0,i<n;i++){
      |                        ^
      |                        ;
Language: C

// 全探索
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<algorithm>
#include<iostream>

using namespace std;

const int MAX_N = 20;
const int MAX_N_2 = 100000000;
const int MAX_Q = 200;

// 入力値を保持するバッファ
int input_buffer[MAX_N + 1];
// 組み合わせの管理用バッファ
int comb_buffer[MAX_N + 1];
// 組み合わせから求めた和を格納する配列
int pos = 0;
int add_buffer[MAX_N_2];

void combinations(int n, int r);
void comb_sub(int n, int r, int m);
void add_combination(int m);

int main(void)
{
    int n, q, Q[MAX_Q + 1];

    scanf("%d", &n);

    for(int i = 0; i < n; i++)
    {
        scanf("%d", &input_buffer[i]);
    }

    scanf("%d", &q);

    for(int i = 0; i < q; i++)
    {
        scanf("%d", &Q[i]);
    }

    for(int i = 0; i < n; i++)
    {
        combinations(n, i);
    }

    for(int i = 0; i < q; i++)
    {
        bool judge = false;

        for(int j = 0; j < pos; j++)
        {
            if( add_buffer[j] == Q[i] )
            {
                judge = true;
                break;
            }
        }

        if( judge )
        {
            printf("yes\n");
        }
        else
        {
            printf("no\n");
        }
    }

    return 0;
}

// 組み合わせを生成する関数の入り口
void combinations(int n, int r)
{
	if (r > 0 && r <= MAX_N)
	{
		comb_sub(n, r, 0);
	}
}

// 組み合わせを生成する関数
// n : 選択する数値の範囲 ( 1〜 n )
// r : 選ぶ数値の個数
// m : 選んだ数値の個数
void comb_sub(int n, int r, int m)
{
	if ( r == 0 )
	{
        // r が 0 になったので、組み合わせを一つ生成できた
		add_combination(m);
	}
	else if ( n == r )
	{
		for (int i = r; i > 0; i--)
		{
			// n が r と等しくなったならば、残りの数字 (1 から r まで) を全て選択
			comb_buffer[m++] = i;
		}

		add_combination(m);
	}
	else
	{
		// nを選ばない場合
		// 残りの数字の中から r 個の数字を選びます。
		comb_sub(n - 1, r, m);

		// nを選ぶ場合
		// 数字 n を comb_buffer に追加して、残りの数字の中から r - 1 個を選びます。
		comb_buffer[m] = n;
		comb_sub(n - 1, r - 1, m + 1);
	}

    return;
}

// 入力数値の和を求める
void add_combination(int m)
{
    // 配列の初期化
    add_buffer[pos] = 0;

    for(int i = 0; i < m; i++)
    {
    	// 入力された数列の和を順番に求める
        add_buffer[pos] += input_buffer[comb_buffer[i] - 1];
    }

    // 要素を進める
    pos++;

    return;
}



Compiler output:
main.c:2:9: fatal error: cstdio: No such file or directory
    2 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int func(int *A,int n,int i,int num) {
	int ans;
	if (num == 0) {
		return 1;
	}
	if (i >= n) {
		return 0;
	}
	if ((func(A, n, i + 1, num) == 1) || (func(A, n, i + 1, num - A[i]) == 1)) {
		return 1;
	}
	return 0;
	
}

int main(void) {
	int n, q,i;
	int A[20], m[200];
	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf_s("%d", &A[i]);
	}
	scanf_s("%d", &q);
	for (i = 0; i < q; i++) {
		scanf_s("%d", &m[i]);
	}
	for (i = 0; i < q; i++) {
		if (func(A, n, 0, m[i])==1) {
			printf("yes\n");
		}
		else {
			printf("no\n");
		}
	}
}


Compiler output:
main.c: In function 'main':
main.c:20:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   20 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

include <stdio.h>
 
int a[25], n, t;
 
int solve(int i,int sum){
    if(i == n){
        return sum == t;
    }
    if(solve(i + 1,sum + a[i])){
        return 1;
    }
    if(solve(i + 1,sum)){
        return 1;
    }
}
 
int main()
{
    int i, q;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%d", a + i);
    }
    scanf("%d", &q);
    for(i = 0; i < q; i++){
        scanf("%d", &t);
        if(solve(0,0)){
            printf("yes\n");
        }else{
            printf("no\n");
        }
    }   
    return 0;
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'solve':
main.c:6:13: error: 'n' undeclared (first use in this function)
    6 |     if(i == n){
      |             ^
main.c:6:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:23: error: 't' undeclared (first use in this function)
    7 |         return sum == t;
      |                       ^
main.c:9:26: error: 'a' undeclared (first use in this function)
    9 |     if(solve(i + 1,sum + a[i])){
      |                          ^
main.c: In function 'main':
main.c:20:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |     scanf("%d", &n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:20:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |     scanf("%d", &n);
      |     ^~~~~
main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:18: error: 'n' undeclared (first use in this function)
   20 |     scanf("%d", &n);
      |                  ^
main.c:22:21: error: 'a' undeclared (first use in this function)
   22 |         scanf("%d", a + i);
      |                     ^
main.c:26:22: error: 't' undeclared (first use in this function)
   26 |         scanf("%d", &t);
      |                      ^
main.c:28:13: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   28 |             printf("yes\n");
      |             ^~~~~~
main.c:28:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:28:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   30 |             printf("no\n");
      |             ^~~~~~
main.c:30:13: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


#include<stdio.h>

using namespace std;

int n, A[50];

int solve(int i,int m) {
	if (m == 0)return 1;
	if (i >= n)return 0;
	int res = solve(i + 1, m) || solve(i+1,m-A[i]);
	return res;
}

int main()
{
	int q, M, i;

	scanf("%d",&n);
	for (i = 0;i < n;i++)scanf("%d",&A[i]);
	scanf("%d",q);
	for (i = 0;i < q;i++) {
		scanf("%d",&M);
		if (solve(0, M))printf("yes\n");
		else printf("no\n");
	}

    return 0;
}


Compiler output:
main.c:4:1: error: unknown type name 'using'
    4 | using namespace std;
      | ^~~~~
main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    4 | using namespace std;
      |                 ^~~
Language: C

#include<stdio.h>

int A[50],n;

int solve(int i,int m){
  int res;
  if(m==0)return 1;
  if(i>=n)return 0;
  res  = solve(i + 1,m) || solve(i+1;m-A[i]);
  return res;

}
int main(){
  int i,j;
  int q;
  int m;

  scanf("%d",&n);
  if(n<0 || n>20)return 0;

  for(i = 0;i<n;i++){
    scanf("%d",&A[i]);
    if(A[i]<1||A[i]>2000)return 0;
  }

  scanf("%d",&q);
  if(q<0 || q>200)return 0;

  for(i = 0;i<q ;i++){
    scanf("%d",&m);
    if(solve(A,0,m,n) == 1)printf("yes\n");
    else printf("No\n" );
  }

  return 0;
}



Compiler output:
main.c: In function 'solve':
main.c:9:37: error: expected ')' before ';' token
    9 |   res  = solve(i + 1,m) || solve(i+1;m-A[i]);
      |                                 ~   ^
      |                                     )
main.c:9:28: error: too few arguments to function 'solve'
    9 |   res  = solve(i + 1,m) || solve(i+1;m-A[i]);
      |                            ^~~~~
main.c:5:5: note: declared here
    5 | int solve(int i,int m){
      |     ^~~~~
main.c: In function 'main':
main.c:31:14: error: passing argument 1 of 'solve' makes integer from pointer without a cast [-Wint-conversion]
   31 |     if(solve(A,0,m,n) == 1)printf("yes\n");
      |              ^
      |              |
      |              int *
main.c:5:15: note: expected 'int' but argument is of type 'int *'
    5 | int solve(int i,int m){
      |           ~~~~^
main.c:31:8: error: too many arguments to function 'solve'
   31 |     if(solve(A,0,m,n) == 1)printf("yes\n");
      |        ^~~~~
main.c:5:5: note: declared here
    5 | int solve(int i,int m){
      |     ^~~~~
Language: C

#include <stdio.h>
#define N 2000
int main(){
  int n, q,i;
  int A[N],m[N];
  scanf("%d", &n);
  for(i=0;i<n;i++) scanf("%d", &A[i]);
  
  scanf("%d", &q);
  for(i=0;i<q;i++)scanf("%d", &m[i]);
  check(n,q);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'check' [-Wimplicit-function-declaration]
   11 |   check(n,q);
      |   ^~~~~
Language: C

#include<stdio.h>
int main(){
    int i, j, k, n, l = 2, c = 0;
    scanf("%d", &n);
    int A[n];
    for(i = 0; i < n; i++) scanf("%d", &A[i]);
    scanf("%d", &k);
    int B[k];
    for(i = 0; i < k; i++) scanf("%d", &B[i]);
    
    for(c=0;c<n;c++){
        if(l==1) printf(""yes"\n);
        if(l==0) printf(""no"\n");
        l=0;
        for(i=0;i<n;i++){
            if(A[i] < B[c]){
        for(j=0;j<n;j++){
            if(A[j] > B[c]) break;
            if(i==j) continue;
            if(A[i] + A[j] == B[c]) l=1;
            if(A[i] + A[j] == B[c]) break;
            }
            }
        if(A[i] + A[j] == B[c]) break;
    }
    }
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:12:27: error: expected ')' before 'yes'
   12 |         if(l==1) printf(""yes"\n);
      |                        ~  ^~~
      |                           )
main.c:12:30: warning: missing terminating " character
   12 |         if(l==1) printf(""yes"\n);
      |                              ^
main.c:12:30: error: missing terminating " character
   12 |         if(l==1) printf(""yes"\n);
      |                              ^~~~~
main.c:25:6: error: expected ';' before '}' token
   25 |     }
      |      ^
      |      ;
   26 |     }
      |     ~
Language: C

#include <stdio.h>

#define true 1
#define false 0
#define MAX 2000

int main(){

	int n,q;
	int A[MAX],m

	scanf("%d",&n);
	for( i = 0; i < n; i++){
		scanf("%d",&A[i]);
	}

	scanf("%d",&q);
	for( i = 0; i < q; i++){
		scanf("%d",&m);
		if(solve(0,m) == false) printf("no\n");
		else printf("yes\n");
	}
	return 0;
}

int solve(int i, int m){

	int res;

	if(m == 0) return true;
	if(i >= n) return false;
	res = solve(i + 1, m) || solve(i + 1, m - A[i]);
	return res;

}


Compiler output:
main.c: In function 'main':
main.c:12:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
   12 |         scanf("%d",&n);
      |         ^~~~~
main.c:13:14: error: 'i' undeclared (first use in this function)
   13 |         for( i = 0; i < n; i++){
      |              ^
main.c:13:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:29: error: 'm' undeclared (first use in this function)
   19 |                 scanf("%d",&m);
      |                             ^
main.c:20:20: error: implicit declaration of function 'solve' [-Wimplicit-function-declaration]
   20 |                 if(solve(0,m) == false) printf("no\n");
      |                    ^~~~~
main.c: In function 'solve':
main.c:31:17: error: 'n' undeclared (first use in this function)
   31 |         if(i >= n) return false;
      |                 ^
main.c:32:51: error: 'A' undeclared (first use in this function)
   32 |         res = solve(i + 1, m) || solve(i + 1, m - A[i]);
      |                                                   ^
Language: C

#include<stdio.h>
#include<stdlib.h>

int A[2000];

 int search(int n,int A[],int i,int m){
  
  if(m==0) return 1;

  else if(i>=n) return 0;
  
  return (search(n, A, i + 1, m) || search(n, A, i + 1, m - A[i]));
}


extern void solve(int n,int A[],int q,int M){
  int i;
  for(i=0;i<q;i++){
    if(search(n,A,0,M[i])==1)
      printf("yes\n");
    else
      printf("no\n");
  }
  }

int main(){
  int n,M,i,q;
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  // M=(int*)malloc(sizeof(q));
 for(i=0;i<q;i++){
    scanf("%d",&M);
  }

  solve(n,A,q,M);
 
 return 0;
}



Compiler output:
main.c: In function 'solve':
main.c:19:22: error: subscripted value is neither array nor pointer nor vector
   19 |     if(search(n,A,0,M[i])==1)
      |                      ^
Language: C

#include<stdio.h>
int n1,ary[50];

int solve(int i,int value){
  int res;
  if(value==0){
    return 1;
  }
  if(i>=n){
    return 0;
  }
  res=solve(i+1,value) || solve(i+1,value-ary[i]);
  return res;
}

int main(){
  int n2,V,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&ary[i]);
  }
  scanf("%d",&n2);
  for(i=0;i<n2;i++){
    scanf("%d",&V);
    if(solve(0,V))printf("yes\n");
    else printf("no\n");
  }
  return 0;
}



Compiler output:
main.c: In function 'solve':
main.c:9:9: error: 'n' undeclared (first use in this function)
    9 |   if(i>=n){
      |         ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:18:15: error: 'n' undeclared (first use in this function)
   18 |   scanf("%d",&n);
      |               ^
Language: C

#include <stdio.h>

int n, A[100];

int solve(i, m){
  if(m == 0)   return 1;
  if(i >= n)   return 0;
  int res = solve(i + 1, m) || solve(i + 1,m - A[i]);
  return res;
}

int main(){
  int i, q, M;

  scanf("%d", &n);
  for(i = 0; i < n; i++)   scanf("%d",&A[i]);
  scanf("%d", &q);
  for(i = 0; i < q; i++){
    scanf("%d",&M);
    if(solve(0,M))         printf("yes\n");
    else printf("no\n");
  }
  return 0;




Compiler output:
main.c: In function 'solve':
main.c:5:5: error: type of 'i' defaults to 'int' [-Wimplicit-int]
    5 | int solve(i, m){
      |     ^~~~~
main.c:5:5: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c: In function 'main':
main.c:23:3: error: expected declaration or statement at end of input
   23 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>

void saiki(int x, int y);

int n,B[20];

int main(){
  int q,i;
  
  scanf("%d",&n);
  
  int A[n];
  
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    B[i]=A[i];
  }
  
  scanf("%d",&q);

  int M[q];
  
  for(i=0;i<q;i++){
    scanf("%d",&M[i]);
  }

  for(i=0;i<q;i++){
    saiki(0,M[i])
  }

  return 0;
}

void saiki(int x, int y){
  if(y==0)printf("yes\n");
  else if(x>=n)printf("no\n");
  else if(x>y)saiki(x+1,y);
  else if(x<=y)saiki(x+1,y-B[x]);
}
    



Compiler output:
main.c: In function 'main':
main.c:28:18: error: expected ';' before '}' token
   28 |     saiki(0,M[i])
      |                  ^
      |                  ;
   29 |   }
      |   ~
Language: C

#include <stdio.h>

int na;
int a[2000];

int check (int getI,int diff) {
  if (diff == 0) {
    return 1;
  }else if (getI >= na) {
    return 0;
  }
  int res=check(getI+1,diff-a[getI]) || check(getI+1,diff);
  return res;
}

int main () {
  int n;
  int pre;
  scanf("%d",&na);
  for (pre=0;pre<na;pre++) {
    scanf("%d",&a[pre]);
  }
  scanf("%d",&n);
  int target[n];
  for (pre=0;pre<n;pre++) {
    scanf("%d",&target[pre]);
  }
  for (pre=0;pre<n;pre++) {
    int result = check(0,target[pre]);
    if (result) {
      printf("yes\n");
    }else{
      printf("no\n");
    }
  }
  return 0;
}
#include <stdio.h>

int na;
int a[2000];

int check (int getI,int diff) {
  if (diff == 0) {
    return 1;
  }else if (getI >= na) {
    return 0;
  }
  int res=check(getI+1,diff-a[getI]) || check(getI+1,diff);
  return res;
}

int main () {
  int n;
  int pre;
  scanf("%d",&na);
  for (pre=0;pre<na;pre++) {
    scanf("%d",&a[pre]);
  }
  scanf("%d",&n);
  int target[n];
  for (pre=0;pre<n;pre++) {
    scanf("%d",&target[pre]);
  }
  for (pre=0;pre<n;pre++) {
    int result = check(0,target[pre]);
    if (result) {
      printf("yes\n");
    }else{
      printf("no\n");
    }
  }
  return 0;
}



Compiler output:
main.c:43:5: error: redefinition of 'check'
   43 | int check (int getI,int diff) {
      |     ^~~~~
main.c:6:5: note: previous definition of 'check' with type 'int(int,  int)'
    6 | int check (int getI,int diff) {
      |     ^~~~~
main.c:53:5: error: redefinition of 'main'
   53 | int main () {
      |     ^~~~
main.c:16:5: note: previous definition of 'main' with type 'int()'
   16 | int main () {
      |     ^~~~
Language: C

#include <stdio.h>
int A[2000];
int solve(int,int);
int main(){
  int i,n,q,m[2000];

  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",A[i]);
  scanf("%d",&q);
  for(i=0;i<n;i++) scanf("%d",m[i]);

  if(solve(n,m)==true) printf("yes\n");
  if(solce(n,m)==false) printf("no\n");

  return 0;
}

int solve(int i,int m){
  if(m==0) return true;
  if(i>=n) return false;
  res=solve(i+1,m) || solve(i+1,m-A[i]);
  return res;
}



Compiler output:
main.c: In function 'main':
main.c:12:14: error: passing argument 2 of 'solve' makes integer from pointer without a cast [-Wint-conversion]
   12 |   if(solve(n,m)==true) printf("yes\n");
      |              ^
      |              |
      |              int *
main.c:3:15: note: expected 'int' but argument is of type 'int *'
    3 | int solve(int,int);
      |               ^~~
main.c:12:18: error: 'true' undeclared (first use in this function)
   12 |   if(solve(n,m)==true) printf("yes\n");
      |                  ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | int A[2000];
main.c:12:18: note: each undeclared identifier is reported only once for each function it appears in
   12 |   if(solve(n,m)==true) printf("yes\n");
      |                  ^~~~
main.c:13:6: error: implicit declaration of function 'solce'; did you mean 'solve'? [-Wimplicit-function-declaration]
   13 |   if(solce(n,m)==false) printf("no\n");
      |      ^~~~~
      |      solve
main.c:13:18: error: 'false' undeclared (first use in this function)
   13 |   if(solce(n,m)==false) printf("no\n");
      |                  ^~~~~
main.c:13:18: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'solve':
main.c:19:19: error: 'true' undeclared (first use in this function)
   19 |   if(m==0) return true;
      |                   ^~~~
main.c:19:19: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:20:9: error: 'n' undeclared (first use in this function)
   20 |   if(i>=n) return false;
      |         ^
main.c:20:19: error: 'false' undeclared (first use in this function)
   20 |   if(i>=n) return false;
      |                   ^~~~~
main.c:20:19: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:21:3: error: 'res' undeclared (first use in this function)
   21 |   res=solve(i+1,m) || solve(i+1,m-A[i]);
      |   ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>

int *s;
int *m;
int n, q;

int judge(int a){
  int sum;
  int i,j;

  for (i = 0; i < n-1; i++) {
    for(j = i+1; j<n; j++){
      if(a==s[i]||a==a[j])return 1;
      sum = s[i]+s[j];
      if (sum==a) {
        //printf("%d + %d = %d: ",s[i],s[j],a);
        return 1;
      }
    }
  }
  return 0;
}

int main() {
  int i,j;
  int key;

//要素数と要素の読み込み
  scanf("%d",&n);
  s = (int*)malloc(sizeof(int) * n);
  for(i=0; i<n; i++){
    //printf("s[%d]: ",i);
    scanf("%d",&s[i]);
  }
  scanf("%d",&q);
  m = (int*)malloc(sizeof(int) * q);
  for(i=0; i<q; i++){
    //printf("m[%d]: ",i);
    scanf("%d",&m[i]);
  }

  for (i = 0; i < q; i++) {
    if(1==judge(m[i])){
      printf("yes\n" );
    }else printf("no\n" );
  }
/*
  for (i = 0; i < n-1; i++) {
    for(j = i + 1; j < n; j++){
      judge(s[i],s[j]);
    }
  }
*/
  return 0;
}



Compiler output:
main.c: In function 'judge':
main.c:14:23: error: subscripted value is neither array nor pointer nor vector
   14 |       if(a==s[i]||a==a[j])return 1;
      |                       ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 2000

int A[N],n;

int solve(int n,int A[],int i,int B)
{
  int res;
  if(B==0) return 1;

  else if(m >= n) return 0;

  return (solve(n,A,i+1,B) || solve(n,A,i+1,B-A[i]));
}

int main()
{
  int i,j,m,B[200],sum;

  scanf("%d",&n);
  if(n > 20) exit(3);
  for(i=0; i<n; i++){
    scanf("%d",&A[i]);
  }

  scanf("%d",&m);  
  for(j=0; j<m; j++){
    scanf("%d",&B[j]);    
  }

  for(i=0; i<m; i++){
    sum = solve(n,A,0,B[i]);
    if(sum == 1) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}



Compiler output:
main.c: In function 'solve':
main.c:12:11: error: 'm' undeclared (first use in this function)
   12 |   else if(m >= n) return 0;
      |           ^
main.c:12:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int n,A[200];

int solve(int i,int m) {
  if(m == 0) return 1;
  if(i >= n) return 0;
  int res = solve(i+1,m) || solve(i+1,m-A[i]);
  return res;

}

int main () {
  int q,M,i;

  scanf("%d",&d\n);
  for(i=0;i<n;i++) {
    scanf("%d",&A[i]);
    scanf("%d",&q);
  }
  for(i=0;i<q;i++) {
    scanf("%d",&M);
    if(solve(0,M)) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}

  
  



Compiler output:
main.c: In function 'main':
main.c:16:16: error: stray '\' in program
   16 |   scanf("%d",&d\n);
      |                ^
main.c:16:15: error: 'd' undeclared (first use in this function)
   16 |   scanf("%d",&d\n);
      |               ^
main.c:16:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:16: error: expected ')' before 'n'
   16 |   scanf("%d",&d\n);
      |        ~       ^~
      |                )
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>

#define Binary 20
void bb(int *b){
  int i;
  for(i = 0; i < Binary; i++){
    if(b[i] == 0){
      b[i] = 1;
      break;
    }
    else{
      b[i] = 0;
    }
  }
}

int roopNum(int n){
  int i;
  int sum = 0;
  for(i = 0; i < n; i++){
    sum += pow(2, i);
  }
  return sum;
}

void dis(int *b){
  int i;
  for(i = 0; i < Binary; i++){
    printf("%d",b[i]);
  }
  printf("\n");
}

void Nacht(int *A, int n, int m, int r){
  int b[Binary];
  int i, j, sum;
  for(i =0; i < Binary; i++){
         b[i] = 0;
  }
  for(i = 0; i < r; i++){
    bb(b);
    //dis(b);
    sum = 0;
    for(j = 0; j < n; j++){
      if(b[j] == 1) sum += A[j];
    }
    if(sum == m){
      printf("yes\n");
      return;
    }
  }
  printf("no\n");
}

int Makem(int *A, int i,int n, int m){
}


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'
/usr/bin/ld: /tmp/ccPUHEkb.o: in function `roopNum':
main.c:(.text+0xa4): undefined reference to `pow'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

#define N 2000

int solve(i,m,n){
  int res;
  if(m==0){
    return true;
  }
  if(i>=n){
    return false;
  }
  res = solve(i + 1,m,n) || solve(i+1,m-A[i],n);
  return res;
}

int main(){
  int i,n,q,A[N],M[N],S[N];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    S[i]=0;
    scanf("%d",&A[i]);
  }

  scanf("%d",&q);

  for(i=0;i<q;i++){
    scanf("%d",&M[i]);
  }

  if(i=0;i<q;i++){
    if(solve(0,M[i],q)){
      printf("yes\n");
    }
  }

  return 0;
}



Compiler output:
main.c: In function 'solve':
main.c:5:5: error: type of 'i' defaults to 'int' [-Wimplicit-int]
    5 | int solve(i,m,n){
      |     ^~~~~
main.c:5:5: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:5:5: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:8:12: error: 'true' undeclared (first use in this function)
    8 |     return true;
      |            ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:8:12: note: each undeclared identifier is reported only once for each function it appears in
    8 |     return true;
      |            ^~~~
main.c:11:12: error: 'false' undeclared (first use in this function)
   11 |     return false;
      |            ^~~~~
main.c:11:12: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:13:41: error: 'A' undeclared (first use in this function)
   13 |   res = solve(i + 1,m,n) || solve(i+1,m-A[i],n);
      |                                         ^
main.c: In function 'main':
main.c:33:9: error: expected ')' before ';' token
   33 |   if(i=0;i<q;i++){
      |     ~   ^
      |         )
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int solve(int *,int,int);
int main(){
  int n,q,key;
  int A[2000];
  int i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  printf("\n");
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    makeCombination(A,n,key);
  }
  return 0;
}
int solve(int *A,int n,int key){
  int B[n];
  int i;
  
  for(i=0;i<n;i++){
    strcpy(B[i],A[i]);
  }
  
  
}



Compiler output:
main.c: In function 'main':
main.c:17:5: error: implicit declaration of function 'makeCombination' [-Wimplicit-function-declaration]
   17 |     makeCombination(A,n,key);
      |     ^~~~~~~~~~~~~~~
main.c: In function 'solve':
main.c:26:13: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
   26 |     strcpy(B[i],A[i]);
      |            ~^~~
      |             |
      |             int
In file included from main.c:3:
/usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'int'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
main.c:26:18: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
   26 |     strcpy(B[i],A[i]);
      |                 ~^~~
      |                  |
      |                  int
/usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'int'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
Language: C

#include<stdio.h>

intA[100]

int main(){
    
    int i,q,m[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d",&m[i]);
    }
    
    for(i=0;i<q;i++)
    solve(0,m[i]);
    
}

int solve(int i,int m){
    
    if(m==0) return 1;
    if(i>=n) return 0;
    
    res = solve(i+1,m) || solve(i+1,-A[i]);
    return res;
}


Compiler output:
main.c:3:10: error: expected ';' before 'int'
    3 | intA[100]
      |          ^
      |          ;
    4 | 
    5 | int main(){
      | ~~~       
main.c: In function 'main':
main.c:8:17: error: 'n' undeclared (first use in this function)
    8 |     scanf("%d",&n);
      |                 ^
main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:21: error: 'A' undeclared (first use in this function)
   10 |         scanf("%d",&A[i]);
      |                     ^
main.c:19:5: error: implicit declaration of function 'solve' [-Wimplicit-function-declaration]
   19 |     solve(0,m[i]);
      |     ^~~~~
main.c: In function 'solve':
main.c:26:11: error: 'n' undeclared (first use in this function)
   26 |     if(i>=n) return 0;
      |           ^
main.c:28:5: error: 'res' undeclared (first use in this function)
   28 |     res = solve(i+1,m) || solve(i+1,-A[i]);
      |     ^~~
main.c:28:38: error: 'A' undeclared (first use in this function)
   28 |     res = solve(i+1,m) || solve(i+1,-A[i]);
      |                                      ^
Language: C

#include<stdio.h>

intA[100];
int solve(int int)

int main(){
    
    int i,q,m[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d",&m[i]);
    }
    
    for(i=0;i<q;i++)
    solve(0,m[i]);
    
}

int solve(int i,int m){
    
    if(m==0) return 1;|| solve(i+1,-A[i]);
    return res;
}


Compiler output:
main.c:3:1: warning: data definition has no type or storage class
    3 | intA[100];
      | ^~~~
main.c:3:1: error: type defaults to 'int' in declaration of 'intA' [-Wimplicit-int]
main.c:4:15: error: two or more data types in declaration specifiers
    4 | int solve(int int)
      |               ^~~
main.c: In function 'solve':
main.c:6:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    6 | int main(){
      |           ^
main.c:24:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   24 | int solve(int i,int m){
      |                       ^
main.c:29: error: expected '{' at end of input
Language: C

#include<stdio.h>

intA[100];
int solve(int ,int);

int main(){
    
    int i,q,m[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d",&m[i]);
    }
    
    for(i=0;i<q;i++)
    solve(0,m[i]);
    
}

int solve(int i,int m){
    
    if(m==0) return 1;|| solve(i+1,-A[i]);
    return res;
}


Compiler output:
main.c:3:1: warning: data definition has no type or storage class
    3 | intA[100];
      | ^~~~
main.c:3:1: error: type defaults to 'int' in declaration of 'intA' [-Wimplicit-int]
main.c: In function 'main':
main.c:9:17: error: 'n' undeclared (first use in this function)
    9 |     scanf("%d",&n);
      |                 ^
main.c:9:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:21: error: 'A' undeclared (first use in this function)
   11 |         scanf("%d",&A[i]);
      |                     ^
main.c: In function 'solve':
main.c:26:23: error: expected expression before '||' token
   26 |     if(m==0) return 1;|| solve(i+1,-A[i]);
      |                       ^~
main.c:27:12: error: 'res' undeclared (first use in this function)
   27 |     return res;
      |            ^~~
Language: C

#include<stdio.h>
int n,A[50];
int choice(int i,int m){
  int next;
  if (m==0) return 1;
  if(i>=n) return 0;
  up=choice(i+1,m)||choice(i+1,m-A[i]);
  return up;                                                   
}

int main(){
  int q,M[50],i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&M[i]);
  }
   for(i=0;i<q;i++){
     if(choice(0,M[i])==1)printf("yes\n");
     else printf("no\n");
  }
  return 0;
}
  



Compiler output:
main.c: In function 'choice':
main.c:7:3: error: 'up' undeclared (first use in this function)
    7 |   up=choice(i+1,m)||choice(i+1,m-A[i]);
      |   ^~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>

using namespace std;
#define N 100

int data[N],num1,num2;

bool flag=false;

bool solve(int i,int m){

  if(i>num1) return false;
  else if(m<0) return false;
  if(m== 0){
    flag=true;
    return true;
  }
    else{
      solve(i+1,m);
      solve(i+1,m-data[i]);
  }   
}

int main(){

  int i,m;


  cin >>num1;

  for(i=0;i<num1;i++){
    cin >>data[i];
  }

  cin >>num2;

  for(i=0;i<num2;i++){
    cin >>m;
    flag=false;

    solve(-1,m);
    if(flag==true){
      cout <<"yes"<<endl;
    }  
    else cout <<"no"<<endl;
  }

  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
using namespace std;
const int MAX_N = 20;
int n;
int A[MAX_N];

bool solve(int i, int M) {
	if (i == n) return false;
	if (M - A[i] == 0) return true;
	if (M - A[i] < 0) return solve(i + 1, M);
	return solve(i + 1, M) || solve(i + 1, M - A[i]);
}

int main () {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int M;
		cin >> M;
		cout << (solve(0, M) ? "yes" : "no") << endl;
	}
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,b,n) for(int i=b;i<n;i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int n;
	int q;
	cin>>n;
	int A[20];
	rep(i,n){
		cin>>A[i];
	}
	sort(A,A+n);
	cin>>q;
	int M[200];
	rep(i,q){
		cin>>M[i];
	}
	int sum;
	bool flag[200] ={false};
	rep(i,1<<n){
		sum = 0;

		rep(j,n){
			if((i&(1<<j))){
				sum +=A[j];
				rep(k,q){
					if(flag[k])continue;
					if(sum==M[k]){
						flag[k] = true;
					}
				}
			}
		}
	}
	rep(i,q){
		if(flag[i]){
			cout <<"yes"<<endl;
		}else
			cout <<"no"<<endl;
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: map: No such file or directory
    1 | #include<map>
      |         ^~~~~
compilation terminated.
Language: C

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector< int > A;
bool rec(int now,int sum){
  if(!sum) return true;
  else if(now == A.size() || sum < 0) return false;
  return rec( now + 1, sum - A[now]) || rec( now + 1, sum);
}
int main(){
  int n;
  cin >> n;
  A.resize(n);
  for(int i = 0 ; i < n ; i++ ) cin >> A[i];
  int q;
  cin >> q;
  for(int i = 0 ; i < q ; i++ ){
    int M;
    cin >> M;
    cout << ( rec(0,M) ? "yes" : "no" ) << endl;
  }
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <cstdio>
#include<iostream>

#define MAX 20*2000
using namespace std;
 
int main(void){

	int dp[MAX]={0};
	int n,q;
	int inp;
	int max=0,maxl;
	dp[0]=1;

	cin>>n;

	for(int i=0;i<n;i++){
		cin>>inp;
		maxl=0;
		for(int j=0;j<=max;j++){
			if(dp[j]>=1){
				if(maxl<j+inp) maxl=j+inp;
				dp[j+inp]=1;
			}
		}
		max=maxl;
	}

	cin>>q;

	for(int i=0;i<q;i++){
		cin>>inp;
		if(dp[inp]==1) cout<<"yes"<<endl;
		else cout<<"no"<<endl;
	}

    return 0;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main(void){
  int n, q, num, i, j;
  int a[2001] = {};
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &num);
　　a[num] = 1;
    for(j= 2000-num;j>=0 ; j--){
      if(a[j]) a[j + num] = 1;
    }
  }

  scanf("%d", &q);
  for(i=0; i<q; i++){
    scanf("%d", &num);
    if(a[num]) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}
		 

Compiler output:
main.c: In function 'main':
main.c:8:1: error: stray '\343' in program
    8 | <U+3000><U+3000>a[num] = 1;
      | ^~~~~~~~
main.c:8:3: error: stray '\343' in program
    8 | <U+3000><U+3000>a[num] = 1;
      |         ^~~~~~~~
Language: C

#include<stdio.h>
int A[2000],M[2000],i,q;
void solve(int,int)

void solve(p,t){

if(t-A[p]==0){
printf("yes\n");
return 0;
}
solve(p+1,t-A[p]);

solve(p+1,t);

}
int main(){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&M[i]);
}
for(i=0;i<q;i++){
solve(0,M[i]);
printf("no\n");
}
return 0;
}

Compiler output:
main.c: In function 'solve':
main.c:5:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    5 | void solve(p,t){
      |                ^
main.c:16:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   16 | int main(){
      |           ^
main.c:31: error: expected '{' at end of input
Language: C

#include<stdio.h>
int A[2000],M[2000],i,q;
void solve(int,int);

void solve(p,t){

if(t-A[p]==0){
printf("yes\n");
return 0;
}
solve(p+1,t-A[p]);

solve(p+1,t);

}
int main(){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&M[i]);
}
for(i=0;i<q;i++){
solve(0,M[i]);
printf("no\n");
}
return 0;
}

Compiler output:
main.c: In function 'solve':
main.c:5:6: error: type of 'p' defaults to 'int' [-Wimplicit-int]
    5 | void solve(p,t){
      |      ^~~~~
main.c:5:6: error: type of 't' defaults to 'int' [-Wimplicit-int]
main.c:9:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
    9 | return 0;
      |        ^
main.c:5:6: note: declared here
    5 | void solve(p,t){
      |      ^~~~~
main.c: In function 'main':
main.c:17:13: error: 'n' undeclared (first use in this function)
   17 | scanf("%d",&n);
      |             ^
main.c:17:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define MAX 20
#define N 2001

int a[MAX], n;
void solve(int, int);

int main() {

    int i, m;
    int q[N];

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }

    scanf("%d", &m);
    for (i = 0; i < m; i++) {
        scanf("%d", &q[i]);
        if(solve(0, q[i])) printf("yes\n");
        else printf("no\n");
    }
    return 0;

}

int solve(int p, int t) {
    if(t == 0) return 1;
    if(p == n) return 0;
    if(solve(p+1, t)) return 1;
    if(solve(p+1, t-a[p])) return 1;
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:12: error: void value not ignored as it ought to be
   21 |         if(solve(0, q[i])) printf("yes\n");
      |            ^~~~~
main.c: At top level:
main.c:28:5: error: conflicting types for 'solve'; have 'int(int,  int)'
   28 | int solve(int p, int t) {
      |     ^~~~~
main.c:6:6: note: previous declaration of 'solve' with type 'void(int,  int)'
    6 | void solve(int, int);
      |      ^~~~~
Language: C

#include <stdio.h>
int n,A[20],M[200];
 
int res(int i,int m)
{
  if(A[i]==m) return 1;
  if(i==n) return 0;
  else
    {
      if(result(i+1,m)||result(i+1,m-A[i]))
    return 1;
    }
  return 0;
}
 
main(){
  int i,k;
   
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&A[i]);
    }
  scanf("%d",&k);
  for(i=0;i<k;i++)
    {
      scanf("%d",&M[i]);
    }
 
  for(i=0;i<k;i++)
    {
      if(res(0,M[i]))
    printf("yes\n");
       
      else
    printf("no\n");
    }

Compiler output:
main.c: In function 'res':
main.c:10:10: error: implicit declaration of function 'result' [-Wimplicit-function-declaration]
   10 |       if(result(i+1,m)||result(i+1,m-A[i]))
      |          ^~~~~~
main.c: At top level:
main.c:16:1: error: return type defaults to 'int' [-Wimplicit-int]
   16 | main(){
      | ^~~~
main.c: In function 'main':
main.c:37:5: error: expected declaration or statement at end of input
   37 |     }
      |     ^
Language: C

#include <stdio.h>
int n,A[20],M[200];
 
int res(int i,int m)
{
  if(A[i]==m) return 1;
  if(i==n) return 0;
  else
    {
      if(res(i+1,m)||res(i+1,m-A[i]))
    return 1;
    }
  return 0;
}
 
main(){
  int i,k;
   
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&A[i]);
    }
  scanf("%d",&k);
  for(i=0;i<k;i++)
    {
      scanf("%d",&M[i]);
    }
 
  for(i=0;i<k;i++)
    {
      if(res(0,M[i]))
    printf("yes\n");
       
      else
    printf("no\n");
    }

Compiler output:
main.c:16:1: error: return type defaults to 'int' [-Wimplicit-int]
   16 | main(){
      | ^~~~
main.c: In function 'main':
main.c:37:5: error: expected declaration or statement at end of input
   37 |     }
      |     ^
Language: C

#include<stdio.h>

#define N 20
#define Q 200

int n,q,ar1[N],ar2[Q];
int i,j;
int sugi;
int main()
{
  
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&ar1[i]);
    }
  scanf("%d",&q);
 for(i=0;i<q;i++)
    {
      scanf("%d",&ar2[i]);
    }

 for(i=0;i<q;i++)
   {
     sugi = 0;
     solve(0,ar2[i]);
     if(sugi==TRUE)
       {
	 printf("yes\n");
       }
     else
       {
	 printf("no\n");
       }
   }
 return 0;
}

void solve(int a, int b);
{
  if(a==n)
    {
      if(b==0)
	{
	  sugi=1;
	}
    }

  else
    {
      solve(a+1,b-ar1[a]);
      solve(a+1,b);
    }
}

Compiler output:
main.c: In function 'main':
main.c:26:6: error: implicit declaration of function 'solve' [-Wimplicit-function-declaration]
   26 |      solve(0,ar2[i]);
      |      ^~~~~
main.c:27:15: error: 'TRUE' undeclared (first use in this function)
   27 |      if(sugi==TRUE)
      |               ^~~~
main.c:27:15: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:39:6: warning: conflicting types for 'solve'; have 'void(int,  int)'
   39 | void solve(int a, int b);
      |      ^~~~~
main.c:26:6: note: previous implicit declaration of 'solve' with type 'void(int,  int)'
   26 |      solve(0,ar2[i]);
      |      ^~~~~
main.c:40:1: error: expected identifier or '(' before '{' token
   40 | {
      | ^
Language: C

#include <stdio.h>
#define M 2000
int solve(int,int);
int n,a[MAX];
int main(){
int b[MAX],c,d,i,j,m;

scanf("%d",&n);

for(i=0;i<n;i++){
scanf("%d",a[i]);
}

scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d",&b[i]);
}

for(i=0;i<m;i++){

if(solve(0,M[i])){
printf("yes\n");
}
else printf("no\n");
}

return 0;
}
int solve(int x,int y){
if(x==y)return 1;
if(x+1>n)return 0;
if(solve(x+1,y-a[x])||solve(x+1,y))return 1;
return 0;
}

Compiler output:
main.c:4:9: error: 'MAX' undeclared here (not in a function)
    4 | int n,a[MAX];
      |         ^~~
main.c: In function 'main':
main.c:21:13: error: subscripted value is neither array nor pointer nor vector
   21 | if(solve(0,M[i])){
      |             ^
Language: C

#include <stdio.h>
#define M 2000
int solve(int,int);
int n,a[MAX];

int main(){
int b[MAX],i,m;

scanf("%d",&n);

for(i=0;i<n;i++){
scanf("%d",a[i]);
}

scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d",&b[i]);
}

for(i=0;i<m;i++){

if(solve(0,M[i])){
printf("yes\n");

}

else printf("no\n");
}

return 0;
}
int solve(int x,int y){
if(x==y)return 1;
if(x+1>n)return 0;
if(solve(x+1,y-a[x])||solve(x+1,y))return 1;
return 0;
}

Compiler output:
main.c:4:9: error: 'MAX' undeclared here (not in a function)
    4 | int n,a[MAX];
      |         ^~~
main.c: In function 'main':
main.c:22:13: error: subscripted value is neither array nor pointer nor vector
   22 | if(solve(0,M[i])){
      |             ^
Language: C

#include <stdio.h>
#define M 2000
int solve(int,int);
int n,a[MAX];

int main(){
int b[MAX],i,m;

scanf("%d",&n);

for(i=0;i<n;i++){
scanf("%d",a[i]);
}

scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d",&b[i]);
}

for(i=0;i<m;i++){
if(solve(0,M[i]))printf("yes\n");
else printf("no\n");
}

return 0;
}
int solve(int x,int y){
if(a[x]==y)return 1;
if(x>=n)return 0;
if(solve(x+1,y-a[x])||solve(x+1,y))return 1;
return 0;
}

Compiler output:
main.c:4:9: error: 'MAX' undeclared here (not in a function)
    4 | int n,a[MAX];
      |         ^~~
main.c: In function 'main':
main.c:21:13: error: subscripted value is neither array nor pointer nor vector
   21 | if(solve(0,M[i]))printf("yes\n");
      |             ^
Language: C

int a[N],m[Q],array[N];
void solve(int,int);

main(){
  
  scanf("%d",&n);
  
  for(i=0;i < n;i++)  scanf("%d",&a[i]);
  
  scanf("%d",&q);
  
  for(i=0;i < q;i++)  scanf("%d",&m[i]);
  
  for(i=0;i < q;i++){
    array[i]=0;
    solve(0,m[i]);
    if(array[i]==1)  printf("yes\n");
    else printf("no\n");
  }
  return 0;
}

void solve(int l,int m){
  if (m == 0) array[i]=1;
  if(m>0 && l<n){
    solve(l+1,m-a[l]);
    solve(l+1,m);
  }
}

Compiler output:
main.c:1:7: error: 'N' undeclared here (not in a function)
    1 | int a[N],m[Q],array[N];
      |       ^
main.c:1:12: error: 'Q' undeclared here (not in a function)
    1 | int a[N],m[Q],array[N];
      |            ^
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int a[N],m[Q],array[N];
main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |   scanf("%d",&n);
      |   ^~~~~
main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:15: error: 'n' undeclared (first use in this function)
    6 |   scanf("%d",&n);
      |               ^
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:7: error: 'i' undeclared (first use in this function)
    8 |   for(i=0;i < n;i++)  scanf("%d",&a[i]);
      |       ^
main.c:10:15: error: 'q' undeclared (first use in this function)
   10 |   scanf("%d",&q);
      |               ^
main.c:17:22: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |     if(array[i]==1)  printf("yes\n");
      |                      ^~~~~~
main.c:17:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:22: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:10: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   18 |     else printf("no\n");
      |          ^~~~~~
main.c:18:10: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'solve':
main.c:24:21: error: 'i' undeclared (first use in this function)
   24 |   if (m == 0) array[i]=1;
      |                     ^
main.c:25:15: error: 'n' undeclared (first use in this function)
   25 |   if(m>0 && l<n){
      |               ^
Language: C

#include <stdio.h>

#define MAX 2000;

int n;
main(){
  int A[MAX];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);

  }





}


int makeCombination(){
  
for(i=0; i<n-1;i++){
        
  rec(0,0);
	  }

	      }


int rec(i,sum){
  if i == n  return;

    rec(i+1)
    
    rec(i+1)
	      }

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:17: error: expected ']' before ';' token
    3 | #define MAX 2000;
      |                 ^
main.c:7:9: note: in expansion of macro 'MAX'
    7 |   int A[MAX];
      |         ^~~
main.c:10:7: error: 'i' undeclared (first use in this function)
   10 |   for(i=0;i<n;i++){
      |       ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:17: error: 'A' undeclared (first use in this function)
   11 |     scanf("%d",&A[i]);
      |                 ^
main.c: In function 'makeCombination':
main.c:24:5: error: 'i' undeclared (first use in this function)
   24 | for(i=0; i<n-1;i++){
      |     ^
main.c:26:3: error: implicit declaration of function 'rec' [-Wimplicit-function-declaration]
   26 |   rec(0,0);
      |   ^~~
main.c: In function 'rec':
main.c:32:5: error: type of 'i' defaults to 'int' [-Wimplicit-int]
   32 | int rec(i,sum){
      |     ^~~
main.c:32:5: error: type of 'sum' defaults to 'int' [-Wimplicit-int]
main.c:33:6: error: expected '(' before 'i'
   33 |   if i == n  return;
      |      ^
      |      (
main.c:35:13: error: expected ';' before 'rec'
   35 |     rec(i+1)
      |             ^
      |             ;
   36 | 
   37 |     rec(i+1)
      |     ~~~