-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBAEKJOON_10815
More file actions
51 lines (38 loc) ยท 1.29 KB
/
BAEKJOON_10815
File metadata and controls
51 lines (38 loc) ยท 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
//static int ans = Integer.MAX_VALUE;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//์๊ทผ์ด๊ฐ ๊ฐ์ง๊ณ ์๋ ์นด๋ ๊ฐ์
int N = Integer.parseInt(br.readLine());
int[] N1=new int[N];
StringTokenizer st =new StringTokenizer(br.readLine());
for(int i=0; i<N; i++){
N1[i] = Integer.parseInt(st.nextToken());
}
int M = Integer.parseInt(br.readLine());
int[] M1 = new int[M];
StringTokenizer st2 = new StringTokenizer(br.readLine());
for(int i=0; i<M; i++){
M1[i] = Integer.parseInt(st2.nextToken());
}
for(int i=0; i<M; i++){
for(int j=0; j<N; j++){
if(M1[i] == N1[j]){
M1[i] =1;
}
if(j==N-1 && M1[i]!=1){
M1[i] =0;
}
}
}
for(int res : M1){
bw.write(String.valueOf(res)+" ");
bw.flush();
}
bw.close();
}
}