UNICORN 编程竞赛 2026(第 477 场 AtCoder Beginner Contest)
交通信号灯AI (CI翻译)
Problem Statement
题目描述
AI (CI翻译)The color of a certain traffic light changes periodically in the order B (blue), Y (yellow), R (red), B (blue), Y (yellow), R (red), $\dots$.
某个交通信号灯的颜色按照 B(蓝色)、Y(黄色)、R(红色)、B(蓝色)、Y(黄色)、R(红色)、$\dots$ 的顺序周期性变化。AI (CI翻译)
You are given a character $c$ representing the current color of the traffic light. Output the next color of the traffic light.
给定一个字符 $c$,表示交通信号灯当前的颜色。请输出交通信号灯的下一个颜色。AI (CI翻译)
Constraints
约束条件
AI (CI翻译)$c$is one ofB,Y, andR.
$c$是B、Y、R之一。
Input
输入格式
AI (CI翻译)The input is given from Standard Input in the following format:
输入从标准输入按以下格式给出:AI (CI翻译)
c
cAI (CI翻译)
Output
输出格式
AI (CI翻译)Output the character representing the next color of the traffic light.
输出一个字符,表示交通信号灯的下一个颜色。AI (CI翻译)
样例
Input #1
B
Output #1
Y
The color after `B` (blue) is `Y` (yellow). Thus, output `Y`.
Input #2
R
Output #2
B
The color after red is blue.
Input #3
Y
Output #3
R
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。