#abc371e. E - I Hate Sigma Problems
E - I Hate Sigma Problems
Score : points
问题陈述
给定一个长度为 的整数序列 。定义 为:
- 子序列 中不同值的数量。
计算以下表达式:
。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given a sequence of integers of length . Define as:
- the number of distinct values in the subsequence .
Evaluate the following expression:
.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
1 2 2
Sample Output 1
8
Consider . The subsequence contains distinct values, so .
Consider . The subsequence contains distinct value, so .
The sum of is .
Sample Input 2
9
5 4 2 2 3 2 4 4 1
Sample Output 2
111