-->
当前位置:首页 > 题库 > 正文内容

编程题:Least Prefix

Luz3年前 (2022-07-07)题库418
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






答案:若无答案欢迎评论

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。