10
4 that
3 be
0 to
1 be
5 question
1 or
2 not
4 is
2 to
4 the

#### 範例輸出

1 3 5 6 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10

#### 額外解釋

「0」出現了1次，所以輸出「1」。「0」和「1」共出現3次，所以輸出「3」。「0」、「1」、「2」共出現5次，所以輸出「5」。依此類推，共會輸出100個累計數量。

#### 參考答案

```import java.util.*;

public class Solution {

public static void main(final String[] args) {
final Scanner in = new Scanner(System.in);
final int n = Integer.parseInt(in.nextLine());

final int[] A = new int[n];
final String[] S = new String[n];
final int[] count = new int[100];
for (int i = 0; i < n; ++i) {
final String[] tokens = in.nextLine().split(" ");
A[i] = Integer.parseInt(tokens[0]);
S[i] = tokens[1];
++count[A[i]];
}
final StringBuilder sb = new StringBuilder();
int sum = 0;
for (int i = 0; i < 100; ++i) {
sum += count[i];
sb.append(sum).append(" ");
}
System.out.println(sb.toString().trim());
}
}```