-->
当前位置:首页 > 题库

编程题:Least Prefix

Luz4年前 (2022-07-07)题库538
Given a non-empty array of N integers A, please find the smallest integer P such that all the numbers in A are in the subarray A[0..P].

### Input Format:

A positive number N, followed by a list of N non-negative integers less than 1000000. N is no larger than 1000000.

### Output Format:

The smallest integer P.

### Sample Input:

in
6
2 2 1 2 0 1


### Sample Output:

out
4






答案:若无答案欢迎评论