A vector R is a vector that is composed of two parts:
such that the part and the part are ordered strictly in increasing order but . We also have that . That is, neither part is empty.
We need to implement the function
int vectorR(const vector<int>& v) with the
following specification:
PRE:
is a vector R and
.
POST: The position of
in
.
You only need to send the function we ask for and the actions and functions that you define yourself. The rest will be ignored.
An undetermined number of vectors R with the following format: an integer indicating their size, and then the vector R. Every vector R has a size greater than or equal to 3.
The position within the vector where is.
ENTRADA 1: 15 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 SORTIDA 1: 5 ENTRADA 2: 15 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 SORTIDA 2: 13 ENTRADA 3: 15 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 SORTIDA 3: 1 ENTRADA 4: 15 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 SORTIDA 4: 14