問題一覧 > 通常問題

No.1468 Colourful Pastel

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 256 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 140
作問者 : Renoirryou
お気に入りにしたユーザー ProblemId : 6236 / 自分の提出
問題文最終更新日: 2026-10-16 15:48:43
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original

Problem Statement

*Depending on the language used, your solution may get TLE.

RenoirRyou bought a set of $N$ pastels at a certain art supply store, but

while using them, one pastel of a certain colour went missing.

Output the missing colour as $S$.

Here, let $A$ be the set of pastels originally bought,

and let $B$ be the set of pastels after the one pastel of a certain colour went missing.

Input

$N$
$A_1\ A_2\ \dots\ A_N$
$B_1\ B_2\ \dots\ B_{N-1}$

$2 \le N \le 10^5$
$B$ is the sequence obtained by removing $1$ pastel from $A$, and the order of the remaining pastels is the same as in $A$.
A and B are each space-separated strings, each being one of the 7 colours $Red,Orange,Yellow,Green,Cyan,Blue,Violet$.
Note that there may be duplicates.

Output

Print a newline at the end.

Sample

Sample 1
Input
4
Red Blue Violet Red
Red Blue Red
Output
Violet

Comparing the two sets, Violet is missing,
so Violet is the appropriate output as the missing colour.

Sample 2
Input
2
Blue Red
Red
Output
Blue

Sample 3
Input
6
Red Red Red Red Red Red
Red Red Red Red Red
Output
Red

It seems RenoirRyou really loves the colour red.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。