题目如下: Binary Search
For a given sequence A={a0,a1,...,an−1}A={a0,a1,...,an−1} which is sorted by ascending order, find a specific value kkgiven as a query.
InputThe input is given in the following format.
nn a0a1,...,an−1a0a1,...,an−1 qq k1k1 k2k2 : kqkqThe number of elements nn and each element aiai are given in the first line and the second line respectively. In the third line, the number of queries qq is given and the following qq lines, qq integers kiki are given as queries.
OutputFor each query, print 1 if any element in AA is equivalent to kk, and 0 otherwise.
Constraints