Jim and the Skyscrapers
Medium
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given an array . Find the number of pairs of indices that satisfy the following conditions: and .
Input
The first line contains one integer . The second line contains integers .
Output
Print the number of such pairs of indices.
Examples
In the first example, the desired pairs are: and .
Input #1
Answer #1
Input #2
Answer #2
Submissions 385
Acceptance rate 39%