#P9785. [ROIR 2020] 对常规的斗争 (Day1)
[ROIR 2020] 对常规的斗争 (Day1)
Problem Description
Translated from ROIR 2020 Day1 T3. Борьба с рутиной , translator: ShineEternal.
An important factor in evaluating an employee's performance is the ability to handle routine tasks.
We consider an employee's work over consecutive days. The task performed on day is .
To evaluate the employee's performance, we use the following method:
Choose an integer and consider all consecutive segments of days. For each such segment, count the number of different types of tasks the employee completed.
Let be the sum, over all such consecutive -day segments, of the number of distinct task types completed in that segment.
Now you need to compute .
Input Format
The input consists of two lines.
The first line contains an integer , representing the total number of working days.
The second line contains integers, representing the task type ID done each day.
Output Format
Output numbers, which are .
5
1 3 2 1 2
5 8 8 6 3
3
10 10 10
3 2 1
Hint
Sample 1 Explanation
- :
| Segment | All task types | Number of distinct task types |
|---|---|---|
So .
- :
| Segment | All task types | Number of distinct task types |
|---|---|---|
So .
- :
| Segment | All task types | Number of distinct task types |
|---|---|---|
So .
- :
| Segment | All task types | Number of distinct task types |
|---|---|---|
So .
- :
| Segment | All task types | Number of distinct task types |
|---|---|---|
So .
Constraints
For of the testdata, , .
| Subtask ID | Special Constraints | Score |
|---|---|---|
| No special constraints |
Translated by ChatGPT 5