118. Colors

Codeforces
IDCF10269118
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
In computer graphics, colors are often given as three integers $R$, $G$, and $B$, each ranging from 0 to 255, inclusive. When displaying a bright red color, $R$ = 255, $G$ = 0, and $B$ = 0. When displaying a bright green color, $R$ = 0, $G$ = 255, and $B$ = 0. When displaying a bright blue color, $R$ = 0, $G$ = 0, and $B$ = 255. When displaying a bright yellow color, $R$ = 255, $G$ = 255, and $B$ = 0. Given this information, figure out which color corresponds to a RGB-format color given in the input. The only line of input contains three space-separated integers $R$, $G$, and $B$: the values of $R$, $G$, and $B$ as described above. Output a single string: the color that the input values would display when drawn on a computer screen. If the color is red, output "RED" (no quotes) If the color is green, output "GREEN" (no quotes) If the color is blue, output "BLUE" (no quotes) If the color is yellow, output "YELLOW" (no quotes) ## Input The only line of input contains three space-separated integers $R$, $G$, and $B$: the values of $R$, $G$, and $B$ as described above. ## Output Output a single string: the color that the input values would display when drawn on a computer screen.If the color is red, output "RED" (no quotes)If the color is green, output "GREEN" (no quotes)If the color is blue, output "BLUE" (no quotes)If the color is yellow, output "YELLOW" (no quotes) [samples]
**Definitions** Let $ (R, G, B) \in \{0, 1, \dots, 255\}^3 $ be the input RGB values. **Constraints** $ 0 \leq R, G, B \leq 255 $ **Objective** Determine the color name based on the following rules: - If $ R = 255 $, $ G = 0 $, $ B = 0 $, output "RED" - If $ R = 0 $, $ G = 255 $, $ B = 0 $, output "GREEN" - If $ R = 0 $, $ G = 0 $, $ B = 255 $, output "BLUE" - If $ R = 255 $, $ G = 255 $, $ B = 0 $, output "YELLOW"
API Response (JSON)
{
  "problem": {
    "name": "118. Colors",
    "description": {
      "content": "In computer graphics, colors are often given as three integers $R$, $G$, and $B$, each ranging from 0 to 255, inclusive.  When displaying a bright red color, $R$ = 255, $G$ = 0, and $B$ = 0. When di",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269118"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "In computer graphics, colors are often given as three integers $R$, $G$, and $B$, each ranging from 0 to 255, inclusive. \n\nWhen displaying a bright red color, $R$ = 255, $G$ = 0, and $B$ = 0.\n\nWhen di...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ (R, G, B) \\in \\{0, 1, \\dots, 255\\}^3 $ be the input RGB values.\n\n**Constraints**  \n$ 0 \\leq R, G, B \\leq 255 $\n\n**Objective**  \nDetermine the color name based on the following ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments