問題一覧 > 通常問題

No.571 Three Brothers (Part 2)

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 384
作問者 : nmnmnmnmnmnmnm / テスター : platypus999
お気に入りにしたユーザー ProblemId : 1325 / 自分の提出
問題文最終更新日: 2026-06-25 18:17:19
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 174 (順位表) の他の問題:

Problem Statement

A, B, and C are three brothers.
The brothers' household has the following rules.

・The taller person is superior.
・If their heights are the same, the lighter person is superior.

Given the height and weight of each of A, B, and C, arrange them in order from most superior.

※No two different brothers among the three have both the same height and the same weight.

Input

$H_A$ $W_A$
$H_B$ $W_B$
$H_C$ $W_C$

$H_A$ and $W_A$ are A's height and weight, respectively. The values are always integers. $150 \le H_A \le 200$. $50 \le W_A \le 100$.
$H_B$ and $W_B$ are B's height and weight, respectively. The values are always integers. $150 \le H_B \le 200$. $50 \le W_B \le 100$.
$H_C$ and $W_C$ are C's height and weight, respectively. The values are always integers. $150 \le H_C \le 200$. $50 \le W_C \le 100$.
No two different brothers among the three have both the same height and the same weight.

Output

Output 'A' for A, 'B' for B, and 'C' for C on three lines from top to bottom, in order from most superior.
Also print a newline at the end of the last line.

Sample

Sample 1
Input
170 60
180 55
160 60
Output
B
A
C

B, the tallest, is the most superior.
A, the next tallest, is the second most superior.
C, the shortest, is third.

Sample 2
Input
190 80
170 60
170 50
Output
A
C
B

A, the tallest, is the most superior.
The next tallest are B and C, but C, who is lighter, is the second most superior.
B and C have the same height, but B, who is heavier, is third.

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