AT_abc468_a.Maximal Value
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given an integer sequence of length N: A=(A1,A2,…,AN).
Find the number of integers i between 1 and N−2 (inclusive) satisfying Ai<Ai+1>Ai+2.
给你一个长度为 N 的整数序列:A=(A1,A2,…,AN)。
求满足 Ai<Ai+1>Ai+2 的整数 i 的个数,其中 i 的取值范围为 1 到 N−2(含端点)。
输入格式
The input is given from Standard Input in the following format:
N
A1 A2 … AN
输入从标准输入以如下格式给出:
N
A1 A2 … AN
输出格式
Output the answer.
输出答案。
输入输出样例
输入#1
6 3 1 4 1 5 2
输出#1
2
输入#2
5 1 1 1 2 1
输出#2
1
输入#3
10 7 3 9 8 10 3 1 5 5 4
输出#3
2
说明/提示
Sample 1 Explanation:
Two values i=2,4 satisfy the condition. Thus, output 2.
Constraints
- 3≤N≤100
- 1≤Ai≤100
- All input values are integers.
样例 1 解释:
有两个值 i=2,4 满足条件。因此,输出 2。
限制条件
- 3≤N≤100
- 1≤Ai≤100
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?