4 5 1 0 0 1 0 5 1 1 1 1 1 12 0 0 1 1 1 0 0 0 1 0 1 0 20 0 0 1 0 0 1 1 1 0 0 1 0 0 1 1 1 1 0 1 1
4 10 13 58 For the first test case, the connected components are as follows: * $\lbrace (1,2),(2,3),(2,4),(2,5),(3,4),(4,5) \rbrace$ * $\lbrace (1,3),(3,5) \rbrace$ * $\lbrace (1,4) \rbrace$ * $\lbrace (1,5) \rbrace$ For the second test case, the graph has no edges, so the number of connected components is $10$.
{
"problem": {
"name": "Sum is One",
"description": {
"content": "You are given a sequence $A = (A_1, A_2, \\dots, A_N)$ of length $N$ consisting of $0$s and $1$s. Define a simple undirected graph $G = (V, E)$ with $\\frac{N (N - 1)}{2}$ vertices as follows: * For ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "ttpc2024_1_k"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a sequence $A = (A_1, A_2, \\dots, A_N)$ of length $N$ consisting of $0$s and $1$s. Define a simple undirected graph $G = (V, E)$ with $\\frac{N (N - 1)}{2}$ vertices as follows:\n\n* For ...",
"is_translate": false,
"language": "English"
}
]
}