luogu#P8912. [RC-06] ijk
[RC-06] ijk
Problem Description
Given a sequence , it is guaranteed that .
Compute how many integer triples satisfy:
- .
- .
Input Format
The first line contains a positive integer .
The second line contains positive integers . It is guaranteed that .
Output Format
Output one line with one non-negative integer, which is the answer.
5
2 3 3 4 5
3
10
1 1 2 2 3 3 4 4 5 8
25
Hint
This problem has three subtasks.
All testdata satisfy: , , .
- Subtask ( points): .
- Subtask ( points): .
- Subtask ( points): no special constraints.
Translated by ChatGPT 5