Language: C++

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

//============================================================================
#define pred(x) ((x)-1)
#define succ(x) ((x)+1)
//============================================================================
//============================================================================
//============================================================================
unsigned short *Array;//[]={1, 5, 7,10, 21};
//============================================================================
//============================================================================
//============================================================================
int searchlist(unsigned short n, unsigned short m)
{
    unsigned short  ptr,top,btm,item,res;

    for (item=n, ptr = n/2, top=0,btm=n; item; item>>=1){
        if (Array[ptr]==m)
            return ptr;
        if (m<Array[ptr]){
            btm = ptr;
            ptr = (ptr+top)/2;
        }else{
            top = ptr;
            ptr = (btm+ptr)/2;
        }
    }
    return ptr;
}
//============================================================================
int BubbleSort(unsigned short *ary, int n)
{
    int i,j,k,l, cnt,val;

    for (k=cnt=0, l=n; k<n-1; k++, l--)
    for (i=0,j=1; j<l; i++, j++){
        if (ary[j]<ary[i])
            val=ary[i], ary[i]=ary[j], ary[j]=val, cnt++;
	}
    return cnt;
}
//============================================================================
/*
    n <= 20
    q <= 200
    1<= A <= 2000
    1<= mi <= 2000
*/
//----------------------------------------------------------------------------
int arrayvol(int n)
{
    int i,sum;

    for (i=sum=0; i<n; i++)
        sum+=Array[i];
    return sum;
}
//----------------------------------------------------------------------------
short makenum(unsigned short N, unsigned short M)
{
    unsigned short n,sum;

    if (arrayvol(N)<M)
        return 0;
    while (N){
        sum=Array[n=searchlist(N,M)];
        if (sum==M)
            return 1;
        if (n &&  makenum(n, M-sum))
            return 1;
        N--;
    }
    return 0;
}
//----------------------------------------------------------------------------
void input(FILE *file)
{
    unsigned short Q,N,q,n,i,j,sum;
    unsigned short *M;

    /*for (i=1; i<25; i++)
        printf("%d:%d\n", i, makenum(5, i));
    return;*/
    fscanf(file, "%d", &N);
    Array=malloc(N*sizeof(unsigned short));
    for (n=0; n<N; n++){
        fscanf(file, "%d", &Array[n]);
    }
    BubbleSort(Array, N);
    fscanf(file, "%d", &Q);
    M=malloc(Q*sizeof(unsigned short));
    for (q=0; q<Q; q++){
        fscanf(file, "%d", &M[q]);
    }
    for (q=0; q<Q; q++)
        printf("%s\n", (makenum(N, M[q]))?"yes":"no");
    free(Array);
    free(M);
}
//============================================================================
#ifndef DESKTOP
int main()
{
    input(stdin);
    return 0;
}
#endif

Compiler output:
a.cc: In function 'void input(FILE*)':
a.cc:89:17: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   89 |     Array=malloc(N*sizeof(unsigned short));
      |           ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 |
      |                 void*
a.cc:95:13: error: invalid conversion from 'void*' to 'short unsigned int*' [-fpermissive]
   95 |     M=malloc(Q*sizeof(unsigned short));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*