Adjacent XOR

AtCoder
IDarc145_e
Time2000ms
Memory256MB
Difficulty
You are given two sequences, each of length $N$, consisting of non-negative integers: $A=(A_1,A_2,\ldots,A_{N})$ and $B=(B_1,B_2,\ldots,B_{N})$. Determine whether it is possible to make $A$ equal to $B$ by performing the operation below at most $70000$ times. If it is possible, present a specific sequence of operations that achieves it. * Choose an integer $K\ (1\le K \le N)$. For every integer $i\ (2\leq i \leq K)$, simultaneously replace the value of $A_i$ with $A_{i-1} \oplus A_i$. Here, $\oplus$ denotes bitwise $\mathrm{XOR}$. What is bitwise $\mathrm{XOR}$?The bitwise $\mathrm{XOR}$ of non-negative integers $A$ and $B$, $A\oplus B$, is defined as follows: * When $A\oplus B$ is written in base two, the digit in the $2^k$'s place ($k \geq 0$) is $1$ if exactly one of the digits in that place of $A$ and $B$ are $1$, and $0$ otherwise. For example, $3\oplus 5 = 6$ (in base two: $011\oplus 101 = 110$). ## Constraints * $2 \leq N \leq 1000$ * $0 \leq A_i, B_i < 2^{60}$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $A_1$ $A_2$ $\ldots$ $A_N$ $B_1$ $B_2$ $\ldots$ $B_N$ [samples]
Samples
Input #1
3
1 2 0
1 2 3
Output #1
Yes
2
2 3

In this output, the sequence $A$ is changed as follows:

*   Initially: $A=(1, 2, 0)$.
*   After the $1$\-st operation: $A=(1, 3, 0)$.
*   After the $2$\-nd operation: $A=(1, 2, 3)$.

After the two operations, $A$ and $B$ are equal, achieving the objective.
Input #2
2
10 100
1 0
Output #2
No
Input #3
2
1152921504606846975 0
1152921504606846975 0
Output #3
Yes
0
API Response (JSON)
{
  "problem": {
    "name": "Adjacent XOR",
    "description": {
      "content": "You are given two sequences, each of length $N$, consisting of non-negative integers: $A=(A_1,A_2,\\ldots,A_{N})$ and $B=(B_1,B_2,\\ldots,B_{N})$. Determine whether it is possible to make $A$ equal to $",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc145_e"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given two sequences, each of length $N$, consisting of non-negative integers: $A=(A_1,A_2,\\ldots,A_{N})$ and $B=(B_1,B_2,\\ldots,B_{N})$.\nDetermine whether it is possible to make $A$ equal to $...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments