/*
#include <stdio.h>
int main()
{
int i, n;
int count_a=0, count_b=0, count_c=0, count_d=0, count_e=0, count_f=0, count_g=0, count_h=0, count_i=0, count_j=0, count_k=0, count_l=0, count_m=0, count_n=0, count_o=0, count_p=0, count_q=0, count_r=0, count_s=0, count_t=0, count_u=0, count_v=0, count_w=0, count_x=0, count_y=0, count_z=0;
n=1000;
char arr[100]={};
for(i=0; i<=n; i++)
{
scanf("%c", &arr[i]);
if(arr[i] == '\n')
{
break;
}
else
{
if(arr[i]=='a')
{
count_a+=1;
}
else if(arr[i]=='b')
{
count_b+=1;
}
else if(arr[i]=='c')
{
count_c+=1;
}
else if(arr[i]=='d')
{
count_d+=1;
}
else if(arr[i]=='e')
{
count_e+=1;
}
else if(arr[i]=='f')
{
count_f+=1;
}
else if(arr[i]=='g')
{
count_g+=1;
}
else if(arr[i]=='h')
{
count_h+=1;
}
else if(arr[i]=='i')
{
count_i+=1;
}
else if(arr[i]=='j')
{
count_j+=1;
}
else if(arr[i]=='k')
{
count_k+=1;
}
else if(arr[i]=='l')
{
count_l+=1;
}
else if(arr[i]=='m')
{
count_m+=1;
}
else if(arr[i]=='n')
{
count_n+=1;
}
else if(arr[i]=='o')
{
count_o+=1;
}
else if(arr[i]=='p')
{
count_p+=1;
}
else if(arr[i]=='q')
{
count_q+=1;
}
else if(arr[i]=='r')
{
count_r+=1;
}
else if(arr[i]=='s')
{
count_s+=1;
}
else if(arr[i]=='t')
{
count_t+=1;
}
else if(arr[i]=='u')
{
count_u+=1;
}
else if(arr[i]=='v')
{
count_v+=1;
}
else if(arr[i]=='w')
{
count_w+=1;
}
else if(arr[i]=='x')
{
count_x+=1;
}
else if(arr[i]=='y')
{
count_y+=1;
}
else if(arr[i]=='z')
{
count_z+=1;
}
}
}
//for(i=0; i<=n; i++)
//{
//if(arr[i]=='\n')
//{
//break;
//}
//else
//{
//printf("%c", arr[i]);
//}
//}
printf("a:%d\n", count_a);
printf("b:%d\n", count_b);
printf("c:%d\n", count_c);
printf("d:%d\n", count_d);
printf("e:%d\n", count_e);
printf("f:%d\n", count_f);
printf("g:%d\n", count_g);
printf("h:%d\n", count_h);
printf("i:%d\n", count_i);
printf("j:%d\n", count_j);
printf("k:%d\n", count_k);
printf("l:%d\n", count_l);
printf("m:%d\n", count_m);
printf("n:%d\n", count_n);
printf("o:%d\n", count_o);
printf("p:%d\n", count_p);
printf("q:%d\n", count_q);
printf("r:%d\n", count_r);
printf("s:%d\n", count_s);
printf("t:%d\n", count_t);
printf("u:%d\n", count_u);
printf("v:%d\n", count_v);
printf("w:%d\n", count_w);
printf("x:%d\n", count_x);
printf("y:%d\n", count_y);
printf("z:%d\n", count_z);
return 0;
}
// 메모이제이션
int memo[100] = {}
arr[3] = 1
if (arr[3] == 0) -> 안 불렸다
#include<stdio.h>
int main()
{
int i;
int n, cnt_class=0, arr[25]={};
scanf("%d", &n);
for(i=1; i<=n; i++)
{
scanf("%d", &cnt_class);
arr[cnt_class]=arr[cnt_class]+1;
}
for(i=1; i<=23; i++)
{
printf("%d ", arr[i]);
}
return 0;
}
*/
#include <stdio.h>
int main()
{
int n, m, i, j, num, memo[100005]={};
scanf("%d", &n);
for(i=0; i<n; i++)
{
scanf("%d", &num);
memo[num] = 1;
}
scanf("%d", &m);
for(j=0; j<m; j++)
{
scanf("%d", &num);
if(memo[num] == 1)
{
printf("1 ");
}
else
{
printf("0 ");
}
}
return 0;
}
얼매알매앟민어치타ㅣㅡㅐ갸햐ㅏㅋ