Problem list
Log in
#r03230 · Online Judge > GoldOJ

Find a Value

Bronze III 2.0 s 1024 MB

An array of $n$ distinct integers and a target $x$ are given. Print the 1-based position of $x$ in the array, or -1 if $x$ is not present.

Input

Line 1: $n$ ($1 \le n \le 1000$). Line 2: $n$ distinct integers in $[0, 3000]$. Line 3: $x$.

Output

Print the position of $x$, or -1.

Example 1

Input
5
3 1 4 2 5
4
Output
3
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code