7 5 1 3 1 10 2 3 1 7 2 3 1 10 2 3
1
3
2
The query processing proceeds as follows:
* In the first query, $3$ is added to $S$, resulting in $S={3}$.
* In the second query, $10$ is added to $S$, resulting in $S={3,10}$.
* In the third query, consider a graph with vertices $3$ and $10$ and no edges. The connected component containing $3$ has a size of $1$, so print $1$.
* In the fourth query, $7$ is added to $S$, resulting in $S={3,7,10}$.
* In the fifth query, consider a graph with vertices $3$, $7$, and $10$, with edges between $3$ and $7$, and $7$ and $10$. The connected component containing $3$ has a size of $3$, so print $3$.
* In the sixth query, $10$ is removed from $S$, resulting in $S={3,7}$.
* In the seventh query, consider a graph with vertices $3$ and $7$, with an edge between them. The connected component containing $3$ has a size of $2$, so print $2$.11 1000000000000000000 1 1 1 100 1 10000 1 1000000 1 100000000 1 10000000000 1 1000000000000 1 100000000000000 1 10000000000000000 1 1000000000000000000 2 1
10
8 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 2 1
1 1
{
"problem": {
"name": "Distance Component Size Query",
"description": {
"content": "You are given an integer $K$. For a set $S$ that is initially empty, process $Q$ queries of the following two types in order: * `1 x`: An integer $x$ is given. If $x$ is in $S$, remove $x$ from $S$",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc356_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given an integer $K$. For a set $S$ that is initially empty, process $Q$ queries of the following two types in order:\n\n* `1 x`: An integer $x$ is given. If $x$ is in $S$, remove $x$ from $S$...",
"is_translate": false,
"language": "English"
}
]
}