#abc313a. A - To Be Saikyo
A - To Be Saikyo
Score : points
问题描述
设有 名编号为 到 的人。每个人都有一个整数得分,称为编程能力;编号为 的人的编程能力为 分。为了让编号为 的人成为最强者,他需要多少更多的分数?换句话说,最小的非负整数 是多少,使得对于所有 ,有 ?
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are people numbered through . Each person has a integer score called programming ability; person 's programming ability is points. How many more points does person need, so that person becomes the strongest? In other words, what is the minimum non-negative integer such that for all ?
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
4
5 15 2 10
Sample Output 1
11
Person becomes the strongest when their programming skill is points or more, so the answer is .
Sample Input 2
4
15 5 2 10
Sample Output 2
0
Person is already the strongest, so no more programming skill is needed.
Sample Input 3
3
100 100 100
Sample Output 3
1
update @ 2024/3/10 08:54:43