3 4 1 3 3 2
6 2 2 In the first query, $1$ is inserted to $S$, making $S=\lbrace 1\rbrace$. Then, $|S|=1$ is added to $A_1$. The sequence becomes $A=(1,0,0)$. In the second query, $3$ is inserted to $S$, making $S=\lbrace 1,3\rbrace$. Then, $|S|=2$ is added to $A_1$ and $A_3$. The sequence becomes $A=(3,0,2)$. In the third query, $3$ is removed from $S$, making $S=\lbrace 1\rbrace$. Then, $|S|=1$ is added to $A_1$. The sequence becomes $A=(4,0,2)$. In the fourth query, $2$ is inserted to $S$, making $S=\lbrace 1,2\rbrace$. Then, $|S|=2$ is added to $A_1$ and $A_2$. The sequence becomes $A=(6,2,2)$. Eventually, the sequence becomes $A=(6,2,2)$.
4 6 1 2 3 2 4 2
15 9 12 7
{
"problem": {
"name": "Set Add Query",
"description": {
"content": "There is an integer sequence $A=(A_1,A_2,\\ldots,A_N)$ of length $N$, where all elements are initially set to $0$. Also, there is a set $S$, which is initially empty. Perform the following $Q$ queries ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc347_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There is an integer sequence $A=(A_1,A_2,\\ldots,A_N)$ of length $N$, where all elements are initially set to $0$. Also, there is a set $S$, which is initially empty.\nPerform the following $Q$ queries ...",
"is_translate": false,
"language": "English"
}
]
}