A vector V is a vector that is composed of two parts:
such that is ordered in a strictly decreasing manner and is ordered in a strictly increasing manner. Furthermore, . Finally, we have that . That is, neither part is empty.
We need to implement the function
int picV(const vector<int>& v) with the following
specification:
PRE:
is a vector V and
.
POST: The position of
in
.
IMPORTANT: You only need to submit the requested
function, and possibly other necessary actions and functions. However,
you must keep the type definitions and #includes.
An undetermined number of vectors V with the following format: an integer indicating their size, and then the vector V. Every vector V has a size greater than or equal to 3.
The position within the vector where is.
ENTRADA 1: 15 7 6 5 4 3 2 1 2 3 4 5 6 7 8 9 SORTIDA 1: 6 ENTRADA 2: 15 15 14 13 12 11 10 9 8 7 6 5 4 3 4 5 SORTIDA 2: 12 ENTRADA 3: 15 15 14 13 12 11 10 9 8 7 6 5 4 3 2 5 SORTIDA 3: 13 ENTRADA 4: 5 2 1 3 5 7 SORTIDA 4: 1 ENTRADA 5: 10 5 4 3 2 1 6 7 18 29 30 SORTIDA 5: 4