#abc272e. E - Add and Mex
E - Add and Mex
Score : points
## 问题描述
给定一个长度为 $N$ 的整数序列 $A=(A_1,A_2,\ldots,A_N)$。
执行以下操作 $M$ 次:
- 对于每个 $i\ (1\leq i \leq N)$,将 $i$ 加到 $A_i$ 上。然后,找出不在 $A$ 中的最小非负整数。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given an integer sequence of length .
Perform the following operation times:
- For each , add to . Then, find the minimum non-negative integer not contained in .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print lines.
The -th line should contain the minimum non-negative integer not contained in after the -th operation.
Sample Input 1
3 3
-1 -1 -6
Sample Output 1
2
2
0
The -st operation makes the sequence
The minimum non-negative integer not contained in is .
The -nd operation makes the sequence
The minimum non-negative integer not contained in is .
The -rd operation makes the sequence
The minimum non-negative integer not contained in is .
Sample Input 2
5 6
-2 -2 -5 -7 -15
Sample Output 2
1
3
2
0
0
0
update @ 2024/3/10 11:27:56