Xor of Sequences

AtCoder
IDjsc2021_b
Time2000ms
Memory256MB
Difficulty
We have two strictly increasing integer sequences $A = (A_1, A_2, \dots, A_N)$ and $B = (B_1, B_2, \dots, B_M)$. Find all integers that appear in exactly one of $A$ and $B$ and print them in ascending order. ## Constraints * All values in input are integers. * $1 \leq N, M \leq 10^3$ * $1 \leq A_1 < A_2 < \dots < A_N \leq 10^3$ * $1 \leq B_1 < B_2 < \dots < B_M \leq 10^3$ ## Input Input is given from Standard Input in the following format: $N$ $M$ $A_1$ $A_2$ $\cdots$ $A_N$ $B_1$ $B_2$ $\cdots$ $B_M$ [samples]
Samples
Input #1
2 2
1 2
1 3
Output #1
2 3

$1$ is contained in both $A$ and $B$;  
$2$ is contained in only $A$;  
$3$ is contained in only $B$.  
Thus, we should print $2$ and $3$.
Input #2
4 4
1 2 3 4
1 2 3 4
Output #2
You can print an empty line or nothing.
API Response (JSON)
{
  "problem": {
    "name": "Xor of Sequences",
    "description": {
      "content": "We have two strictly increasing integer sequences $A = (A_1, A_2, \\dots, A_N)$ and $B = (B_1, B_2, \\dots, B_M)$.   Find all integers that appear in exactly one of $A$ and $B$ and print them in ascendi",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "jsc2021_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We have two strictly increasing integer sequences $A = (A_1, A_2, \\dots, A_N)$ and $B = (B_1, B_2, \\dots, B_M)$.  \nFind all integers that appear in exactly one of $A$ and $B$ and print them in ascendi...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments