公式
A - 455 解説
by
A - 455 解説
by
cn449
初心者の方へ
- プログラミングの学習を始めたばかりで何から手をつけるべきかわからない方は、まずは 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 入門用コンテンツです。
\(A \neq B\) であるか、\(B = C\) であるかをそれぞれ判定すればよいです。
C++ や Python では、\(2\) つの整数が異なることは !=、等しいことは ==、\(2\) つの条件がともに満たされているかは andを用いて判定することができます。
実装例
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a != b and b == c) cout << "Yes\n";
else cout << "No\n";
}
a, b, c = map(int, input().split())
print("Yes" if a != b and b == c else "No")
投稿日時:
最終更新: