A. Infinity Gauntlet

Codeforces
IDCF987A
Time1000ms
Memory256MB
Difficulty
implementation
English · Original
Chinese · Translation
Formal · Original
You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems: * the _Power_ Gem of _purple_ color, * the _Time_ Gem of _green_ color, * the _Space_ Gem of _blue_ color, * the _Soul_ Gem of _orange_ color, * the _Reality_ Gem of _red_ color, * the _Mind_ Gem of _yellow_ color. Using colors of Gems you saw in the Gauntlet determine the names of **absent** Gems. ## Input In the first line of input there is one integer $n$ ($0 \le n \le 6$) — the number of Gems in Infinity Gauntlet. In next $n$ lines there are colors of Gems you saw. Words used for colors are: _purple_, _green_, _blue_, _orange_, _red_, _yellow_. It is guaranteed that all the colors are **distinct**. All colors are given in lowercase English letters. ## Output In the first line output one integer $m$ ($0 \le m \le 6$) — the number of absent Gems. Then in $m$ lines print the names of absent Gems, each on its own line. Words used for names are: _Power_, _Time_, _Space_, _Soul_, _Reality_, _Mind_. Names can be printed in any order. Keep the first letter uppercase, others lowercase. [samples] ## Note In the first sample Thanos already has _Reality_, _Power_, _Mind_ and _Soul_ Gems, so he needs two more: _Time_ and _Space_. In the second sample Thanos doesn't have any Gems, so he needs all six.
你偷看了一眼灭霸佩戴的无限手套。手套中有六个无限宝石的位置: 根据你在手套中看到的宝石颜色,确定缺失的宝石名称。 输入的第一行包含一个整数 $n$ ($0 lt.eq n lt.eq 6$) —— 无限手套中宝石的数量。 接下来的 $n$ 行是你要查看的宝石颜色。使用的颜色词为:_purple_、_green_、_blue_、_orange_、_red_、_yellow_。保证所有颜色互不相同,且所有颜色均为小写英文单词。 第一行输出一个整数 $m$ ($0 lt.eq m lt.eq 6$) —— 缺失宝石的数量。 接下来的 $m$ 行,每行输出一个缺失宝石的名称。使用的名称词为:_Power_、_Time_、_Space_、_Soul_、_Reality_、_Mind_。名称可以按任意顺序输出,但需保持首字母大写,其余字母小写。 在第一个样例中,灭霸已经拥有 _Reality_、_Power_、_Mind_ 和 _Soul_ 宝石,因此他还需要两个:_Time_ 和 _Space_。 在第二个样例中,灭霸没有任何宝石,因此他需要全部六个。 ## Input 输入的第一行包含一个整数 $n$ ($0 lt.eq n lt.eq 6$) —— 无限手套中宝石的数量。接下来的 $n$ 行是你要查看的宝石颜色。使用的颜色词为:_purple_、_green_、_blue_、_orange_、_red_、_yellow_。保证所有颜色互不相同,且所有颜色均为小写英文单词。 ## Output 第一行输出一个整数 $m$ ($0 lt.eq m lt.eq 6$) —— 缺失宝石的数量。然后在 $m$ 行中,每行输出一个缺失宝石的名称。使用的名称词为:_Power_、_Time_、_Space_、_Soul_、_Reality_、_Mind_。名称可以按任意顺序输出,但需保持首字母大写,其余字母小写。 [samples] ## Note 在第一个样例中,灭霸已经拥有 _Reality_、_Power_、_Mind_ 和 _Soul_ 宝石,因此他还需要两个:_Time_ 和 _Space_。在第二个样例中,灭霸没有任何宝石,因此他需要全部六个。
**Definitions:** Let $ C = \{ \text{purple}, \text{green}, \text{blue}, \text{orange}, \text{red}, \text{yellow} \} $ be the set of observed gem colors. Let $ N = \{ \text{Power}, \text{Time}, \text{Space}, \text{Soul}, \text{Reality}, \text{Mind} \} $ be the set of all gem names. Define a bijection $ f: C \to N $ as follows: - $ f(\text{purple}) = \text{Soul} $ - $ f(\text{green}) = \text{Time} $ - $ f(\text{blue}) = \text{Space} $ - $ f(\text{orange}) = \text{Power} $ - $ f(\text{red}) = \text{Reality} $ - $ f(\text{yellow}) = \text{Mind} $ **Given:** - Integer $ n $, $ 0 \leq n \leq 6 $ - Set $ C_{\text{obs}} \subseteq C $, $ |C_{\text{obs}}| = n $, with distinct colors **Objective:** Compute the set of absent gem names: $$ N_{\text{absent}} = N \setminus f(C_{\text{obs}}) $$ Output: - $ m = |N_{\text{absent}}| $ - The elements of $ N_{\text{absent}} $, one per line
Samples
Input #1
4
red
purple
yellow
orange
Output #1
2
Space
Time
Input #2
0
Output #2
6
Time
Mind
Soul
Power
Reality
Space
API Response (JSON)
{
  "problem": {
    "name": "A. Infinity Gauntlet",
    "description": {
      "content": "You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems: *   the _Power_ Gem of _purple_ color, *   the _Time_ Gem of _green_ color, *   the _Space",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF987A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems:\n\n*   the _Power_ Gem of _purple_ color,\n*   the _Time_ Gem of _green_ color,\n*   the _Space...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "你偷看了一眼灭霸佩戴的无限手套。手套中有六个无限宝石的位置:\n\n根据你在手套中看到的宝石颜色,确定缺失的宝石名称。\n\n输入的第一行包含一个整数 $n$ ($0 lt.eq n lt.eq 6$) —— 无限手套中宝石的数量。\n\n接下来的 $n$ 行是你要查看的宝石颜色。使用的颜色词为:_purple_、_green_、_blue_、_orange_、_red_、_yellow_。保证所有颜色互不相...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions:**\n\nLet $ C = \\{ \\text{purple}, \\text{green}, \\text{blue}, \\text{orange}, \\text{red}, \\text{yellow} \\} $ be the set of observed gem colors.  \nLet $ N = \\{ \\text{Power}, \\text{Time}, \\tex...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments