Official
A - Buy a Pen Editorial
by
A - Buy a Pen Editorial
by
toam
初心者の方へ
- プログラミングの学習を始めたばかりで何から手をつけるべきかわからない方は、まずは practice contest の問題A「Welcome to AtCoder」をお試しください。言語ごとに解答例が掲載されています。
- また、プログラミングコンテストの問題に慣れていない方は、 AtCoder Beginners Selection の問題をいくつか試すことをおすすめします。
- C++入門 AtCoder Programming Guide for beginners (APG4b) は、競技プログラミングのための C++ 入門用コンテンツです。
- Python入門 AtCoder Programming Guide for beginners (APG4bPython) は、競技プログラミングのための Python 入門用コンテンツです。
\(C\) が Red
のときは \(\min(G,B)\),Green
のときは \(\min(B,R)\),Blue
のときは \(\min(R,G)\) が答えになります.
このような条件分岐の問題は,if 文を用いて実装することができます.
R, G, B = map(int, input().split())
C = input()
if C == "Red":
print(min(G, B))
if C == "Green":
print(min(B, R))
if C == "Blue":
print(min(R, G))
posted:
last update: