#abc262c. C - Min Max Pair
C - Min Max Pair
Score : points
问题描述
给定一个长度为 的整数序列 ,其中的整数取值范围在 到 之间。
找出满足以下所有条件的整数对 的数量:
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a sequence of length consisting of integers between and .
Find the number of pairs of integers that satisfy all of the following conditions:
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
4
1 3 2 4
Sample Output 1
2
satisfy the conditions.
Sample Input 2
10
5 8 2 2 1 6 7 2 9 10
Sample Output 2
8
update @ 2024/3/10 11:05:56