Tasnim Imran Sunny is the fifth Bangladeshi red coder from Topcoder. This problem is to pay tribute to his unparalleled passion for problem solving.
You will be given an array of integers. After that, you will be given some queries on the following format:
In each query, you will have to answer if there exists an integer from index to in the given array.
The first line of the input will have two integers and , where is the size of the array and is the total number of queries.
Each of the next lines will have one integer , indicating integer at the i’th position of array A.
Each of the following lines will will be in the format a b x, where ( ) and ( ).
Subtask 1 (10 points):
Size of the array
Value of each element
Number of queries
Subtask 2 (20 points):
Size of the array
Value of each element
Number of queries
Subtask 3 (30 points):
Size of the array
Value of each element
Number of queries
Subtask 4 (40 points):
Size of the array
Value of each element
Number of queries
For each query, please print “Yes” if x exists in each query or “No” otherwise.
Input | Output |
---|---|
3 1 1 2 3 0 2 3 | Yes |