3 8 1 0 0 1 0 1 0 1 0 0 1 1 1 0 1 0 2 0 0 1 0 3 1 1 1 1 1 1
Yes 2 3 4 6 7 1 4 5 8 No Yes 0 In the first test case, $A$ is initially $(1,0,0,1,0,1,0,1)$. Performing the operation with $(a,b,c,d)=(3,4,6,7)$ changes $A$ to $(1,0,1,0,0,0,1,1)$. Then, performing the operation with $(a,b,c,d)=(1,4,5,8)$ changes $A$ to $(0,0,1,1,1,0,1,0)$, which matches $B$. In the second test case, it is impossible to make $A$ match $B$. In the third test case, $A$ already matches $B$ from the beginning.
{
"problem": {
"name": "Swap if Equal Length and Sum",
"description": {
"content": "You are given integer sequences $A=(A_1,A_2,\\dots,A_N),\\; B=(B_1,B_2,\\dots,B_N)$ of length $N$ consisting of $0$ and $1$. Let $A[i,j]$ denote the contiguous subsequence from the $i$\\-th through $j$\\-t",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc074_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given integer sequences $A=(A_1,A_2,\\dots,A_N),\\; B=(B_1,B_2,\\dots,B_N)$ of length $N$ consisting of $0$ and $1$. Let $A[i,j]$ denote the contiguous subsequence from the $i$\\-th through $j$\\-t...",
"is_translate": false,
"language": "English"
}
]
}