#abc346c. C - Σ
C - Σ
Score: points
问题陈述
给定一个正整数序列 ,长度为 ,以及一个正整数 。
找出在序列 中不出现的、介于 和 (包括 和 )之间的整数的和。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given a sequence of positive integers of length and a positive integer .
Find the sum of the integers between and , inclusive, that do not appear in the sequence .
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
4 5
1 6 3 1
Sample Output 1
11
Among the integers between and , three numbers, , , and , do not appear in .
Thus, print their sum: .
Sample Input 2
1 3
346
Sample Output 2
6
Sample Input 3
10 158260522
877914575 24979445 623690081 262703497 24979445 1822804784 1430302156 1161735902 923078537 1189330739
Sample Output 3
12523196466007058
update @ 2024/5/16 17:17:51