[CF2289C] 唯一最小值子段计数 (Problem from Ust-Katav)
Problem Statement
You are given a permutation of integers .
A subarray is called good if there does not exist another subarray of the same length with the same value of the minimum element in .
Find the number of good subarrays of the permutation .
Input
First line: (). Each test case: () and permutation . Sum of .
Output
For each test case, output the number of good subarrays.
样例
4
1
1
2
1 2
4
3 2 4 1
7
3 7 5 1 6 4 2
1
3
8
14