No.1468 Colourful Pastel
タグ : / 解いたユーザー数 140
作問者 :
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もしくは右上の雲マークをクリックしてアカウントを作成してください。