7 2 2 1 2 3 5 2 5 4
3 3 3 4 4 3 2 For example, let us explain the procedure for $r = 1$. First, perform the operation "Move the frontmost ball in the sequence to the end of the sequence" once, and the sequence of ball colors becomes $(2, 3, 5, 2, 5, 4, 1)$. Then, proceed with the operation of putting balls into boxes as follows: * First operation: The color of the frontmost ball is $2$. There is no box with at least one but fewer than two balls of color $2$, so put the frontmost ball into the empty box with the smallest box number, box $1$. * Second operation: The color of the frontmost ball is $3$. There is no box with at least one but fewer than two balls of color $3$, so put the frontmost ball into the empty box with the smallest box number, box $2$. * Third operation: The color of the frontmost ball is $5$. There is no box with at least one but fewer than two balls of color $5$ and no empty boxes, so eat the frontmost ball. * Fourth operation: The color of the frontmost ball is $2$. There is a box, box $1$, with at least one but fewer than two balls of color $2$, so put the frontmost ball into box $1$. * Fifth operation: The color of the frontmost ball is $5$. There is no box with at least one but fewer than two balls of color $5$ and no empty boxes, so eat the frontmost ball. * Sixth operation: The color of the frontmost ball is $4$. There is no box with at least one but fewer than two balls of color $4$ and no empty boxes, so eat the frontmost ball. * Seventh operation: The color of the frontmost ball is $1$. There is no box with at least one but fewer than two balls of color $1$ and no empty boxes, so eat the frontmost ball. The final total number of balls in the boxes is $3$, so the answer to the problem for $r = 1$ is $3$.
20 5 4 20 2 20 2 7 3 11 20 3 8 7 9 1 11 8 20 2 18 11 18
14 14 14 14 13 13 13 11 8 9 9 11 13 14 14 14 14 14 14 13
{
"problem": {
"name": "Usual Color Ball Problems",
"description": {
"content": "You are given positive integers $N$, $M$, $K$, and a sequence of positive integers of length $N$, $(C_1, C_2, \\ldots, C_N)$. For each $r = 0, 1, 2, \\ldots, N-1$, print the answer to the following prob",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc337_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given positive integers $N$, $M$, $K$, and a sequence of positive integers of length $N$, $(C_1, C_2, \\ldots, C_N)$. For each $r = 0, 1, 2, \\ldots, N-1$, print the answer to the following prob...",
"is_translate": false,
"language": "English"
}
]
}