Vector R

A vector R is a vector that is composed of two parts:

v = x₁ x₂ x₃ x₄…x_(n) y₁ y₂ y₃…y_(m)

such that the part x₁…x_(n) and the part y₁…y_(m) are ordered strictly
in increasing order but y_(m) < x₁. We also have that n, m > 0. That is,
neither part is empty.

We need to implement the function int vectorR(const vector<int>& v) with
the following specification:

PRE: v is a vector R and ∣ v ∣ ≥ 3.

POST: The position of y₁ in v.

Observation

You only need to send the function we ask for and the actions and
functions that you define yourself. The rest will be ignored.

Input

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.

Output

The position within the vector where y₁ is.

Problem information

Author: PRO1

Generation: 2026-01-25T13:13:21.791Z

© Jutge.org, 2006–2026.
https://jutge.org
