14151415 SUSTech Online Judge
Problem 1415 --Search Problem II

1415: Search Problem II

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 966  Solved: 342
[Submit][Status][Web Board]

Description

Given two arrays A with length n and B with length T. We want to know whether each element in array B is in array A or not.

Input

The 1st line is a positive integer \(n\) \( ( n \leq 10^5) \)

The 2nd line contains \(n\) integers: \( a_1,a_2...a_n.For \ each \ a_i, 0 \leq a_i \leq 10^5 \)

The 3rd line contains a positive integer \(T (T \leq 10^5)\)

The 4th line contains \(T\) integers \(b_1,b_2,...b_T.For \ each \ b_i, 0 \leq b_i \leq 10^5 \)

Output

For each element in \(B\), print "yes" (in a single line, without quotes) if it is in \(A\), otherwise print "no"

Sample Input

4
2 3 9999 1
2
3 99

Sample Output

yes
no

HINT






Note that the integer value ranges are different in Problem 1 and 2






Source

 

[Submit][Status]