CF1211A.Three Problems

入门

通过率:0%

时间限制:3.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Polycarp is choosing three problems for creating a programming test. Totally he has nn problems in his list. The complexity of the ii-th problem equals rir_i. All problems are numerated from 11 to nn.

Help Polycarp to choose such three problems aa, bb and cc, so that the complexity of the first problem strictly less than the complexity of second problem and the complexity of the second problem is strictly less than the complexity of the third problem. So, for chosen problems aa, bb and cc it should be true that ra<rb<rcr_a \lt r_b \lt r_c.

If Polycarp can choose three problems in different ways, you can print any of them.

Polycarp 正在为编程测试挑选三道题目。他总共有 nn 道题目,列于清单中。第 ii 道题目的难度为 rir_i。所有题目编号从 11 到 nn。

请帮助 Polycarp 选出三道题目 aa、bb 和 cc,使得第一道题的难度严格小于第二道题的难度,且第二道题的难度严格小于第三道题的难度。即,对所选题目 aa、bb、cc,需满足 ra<rb<rcr_a \lt r_b \lt r_c。

若 Polycarp 存在多种选法,输出任意一种即可。

输入格式

The first line of the input contains one integer nn (3≤n≤30003 \le n \le 3000) — the number of problems in Polycarp's list.

The second line of the input contains nn integers r1,r2,…,rnr_1, r_2, \dots, r_n (1≤ri≤1091 \le r_i \le 10^9), where rir_i is the complexity of the ii-th problem.

输入的第一行包含一个整数 nn(3≤n≤30003 \le n \le 3000)—— 表示 Polycarp 列表中问题的数量。

输入的第二行包含 nn 个整数 r1,r2,…,rnr_1, r_2, \dots, r_n(1≤ri≤1091 \le r_i \le 10^9),其中 rir_i 表示第 ii 个问题的难度。

输出格式

If Polycarp has no ways to choose three problems, you should print three numbers -1. Ih there is a way to choose them, you should print three different integers a,b,ca, b, c (1≤a,b,c≤n1 \le a, b, c \le n), where aa is the number of the first chosen problem, bb is the number of the second chosen problem and cc is the number of the third chosen problem.

如果波利卡普无法选出三个题目,则应输出三个数字 −1-1。如果存在一种选法,则应输出三个互不相同的整数 a,b,ca, b, c(1≤a,b,c≤n1 \le a, b, c \le n),其中 aa 是第一个所选题目的编号,bb 是第二个所选题目的编号,cc 是第三个所选题目的编号。

输入输出样例

  • 输入#1

    6
    3 1 4 1 5 9

    输出#1

    4 1 3
  • 输入#2

    5
    1 1000000000 1 1000000000 1

    输出#2

    -1 -1 -1
  • 输入#3

    9
    10 10 11 10 10 10 10 10 1

    输出#3

    9 8 3

输入解题思路,AI测评打分。不知道怎么写?

首页