結果

問題 No.571 3人兄弟(その2)
コンテスト
ユーザー mokrai
提出日時 2017-11-02 13:00:11
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 1,542 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 350 ms
コンパイル使用メモリ 20,644 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-05-16 14:53:30
合計ジャッジ時間 2,602 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def main():
    ha, wa = map(int, input().split())
    hb, wb = map(int, input().split())
    hc, wc = map(int, input().split())

    if ha == hb:
        if wa > wb:
            a_is_better_than_b = False
        else:
            a_is_better_than_b = True
    elif ha > hb:
        a_is_better_than_b = True
    else:
        a_is_better_than_b = False

    if ha == hc:
        if wa > wc:
            a_is_better_than_c = False
        else:
            a_is_better_than_c = True
    elif ha > hc:
        a_is_better_than_c = True
    else:
        a_is_better_than_c = False

    if hb == hc:
        if wb > wc:
            b_is_better_than_c = False
        else:
            b_is_better_than_c = True
    elif hb > hc:
        b_is_better_than_c = True
    else:
        b_is_better_than_c = False

    if a_is_better_than_b:
        if b_is_better_than_c:
            print("A")
            print("B")
            print("C")
        else:
            if a_is_better_than_c:
                print("A")
                print("C")
                print("B")
            else:
                print("C")
                print("A")
                print("B")
    else:
        if a_is_better_than_c:
            print("B")
            print("A")
            print("C")
        else:
            if b_is_better_than_c:
                print("B")
                print("C")
                print("A")
            else:
                print("C")
                print("B")
                print("A")

if __name__ == '__main__':
    main()
0