Problem - 1418G - Codeforces
Problem - 1418G - Codeforces
Enter | Register
HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN
Input
The first line contains one integer n (1
5
≤ n ≤ 5 ⋅ 10 ).
→ Problem tags
The second line contains n integers a1 , a2 , ..., an (1 ≤ ai ≤ n ).
data structures divide and conquer
Output hashing two pointers *2500
Print one integer — the number of good subarrays of the array a. No tag edit access
Examples
→ Contest materials
input Copy
9 Announcement
1 2 2 2 1 1 2 2 2
Tutorial #1
output Copy
Tutorial #2 (en)
3
input Copy
10
1 2 3 4 1 2 3 1 2 3
output Copy
input Copy
12
1 2 3 4 3 4 2 1 3 4 2 1
output Copy
Supported by
https://codeforces.com/problemset/problem/1418/G 1/1