問題一覧 > 通常問題

No.543 Proposition

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 580
作問者 : butsurizuki / テスター : Nafmo2
お気に入りにしたユーザー ProblemId : 1632 / 自分の提出
問題文最終更新日: 2026-06-25 11:54:18
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 169 (順位表) の他の問題:

Problem Statement

There is a proposition $P$.
Given the truth values of $P$ and the converse of $P$, determine the truth values of the inverse of $P$ and the contrapositive of $P$.
(Example)
$P$: "If it is 6, then it is a multiple of 3."
This is true.
The converse of $P$: "If it is a multiple of 3, then it is 6."
This is false, because the multiples of 3 include not only 6 but also 3, 9, and so on.
The inverse of $P$: "If it is not 6, then it is not a multiple of 3."
This is false, because 3, 9, and so on are multiples of 3 even though they are not 6.
The contrapositive of $P$: "If it is not a multiple of 3, then it is not 6."
Since 6 is a multiple of 3, it is impossible for something to be 6 without being a multiple of 3; that is, this is true.
In this way, it is known that $P$ and the contrapositive of $P$ have the same truth value, and that the converse of $P$ and the inverse of $P$ have the same truth value.

Input

$a$ $b$

$a$ is the truth value of $P$, and $b$ is the truth value of the converse of $P$. They are given on one line, separated by a space.
・Constraints
$a$,$b$ are each T (true) or F (false)

Output

Output the truth values of the inverse of $P$ and the contrapositive of $P$, in this order, on one line separated by a space, each as T or F, followed by a newline.

Sample

Sample 1
Input
T F
Output
F T

This is the example in the problem statement.

Sample 2
Input
F F
Output
F F

"If it is $\sqrt{2}$, then it is a rational number" is an example of this case.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。