#abc236b. B - Who is missing?

B - Who is missing?

Score : 200200 points

问题描述

我们有 44 张卡片,每张上面写有整数 1144 张卡片写有 22,……,44 张卡片写有 NN,总共是 4N4N 张卡片。

高桥洗乱了这些卡片,从中移除了一张,并把剩下的 4N14N-1 张卡片堆交给你。这堆卡片中的第 ii 张(1i4N11 \leq i \leq 4N - 1)上写有一个整数 AiA_i

找出被高桥移除的那张卡片上的整数。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

We have 44 cards with an integer 11 written on it, 44 cards with 22, \ldots, 44 cards with NN, for a total of 4N4N cards.

Takahashi shuffled these cards, removed one of them, and gave you a pile of the remaining 4N14N-1 cards. The ii-th card (1i4N1)(1 \leq i \leq 4N - 1) of the pile has an integer AiA_i written on it.

Find the integer written on the card removed by Takahashi.

Constraints

  • 1N1051 \leq N \leq 10^5
  • 1AiN(1i4N1)1 \leq A_i \leq N \, (1 \leq i \leq 4N - 1)
  • For each k(1kN)k \, (1 \leq k \leq N), there are at most 44 indices ii such that Ai=kA_i = k.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN

A1A_1 A2A_2 \ldots A4N1A_{4N - 1}

Output

Print the answer.

Sample Input 1

3
1 3 2 3 3 2 2 1 1 1 2

Sample Output 1

3

Takahashi removed a card with 33 written on it.

Sample Input 2

1
1 1 1

Sample Output 2

1

Sample Input 3

4
3 2 1 1 2 4 4 4 4 3 1 3 2 1 3

Sample Output 3

2

update @ 2024/3/10 10:13:17