結果

問題 No.1934 Four Fruits
ユーザー 加藤優太加藤優太
提出日時 2022-05-13 21:51:51
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 695 bytes
コンパイル時間 59 ms
使用メモリ 7,836 KB
最終ジャッジ日時 2023-02-21 14:04:37
合計ジャッジ時間 1,069 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 15 ms
7,760 KB
testcase_01 AC 16 ms
7,792 KB
testcase_02 AC 15 ms
7,680 KB
testcase_03 AC 15 ms
7,836 KB
testcase_04 AC 16 ms
7,636 KB
testcase_05 AC 15 ms
7,724 KB
testcase_06 AC 16 ms
7,676 KB
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 16 ms
7,568 KB
testcase_09 AC 16 ms
7,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def operation(a, b, c):
    res = condition1(a, b, c)
    if res >= 0:
        return res
    res = condition2(a, b, c)
    if res >= 0:
        return res
    res = condition3(a, b, c)
    if res >= 0:
        return res


def condition1(a, b, c):
    res = -1
    if a == b and a == c:
        res = a
    return res


def condition2(a, b, c):
    res = -1
    if a == b and a != c:
        res = c
    elif a == c and a != b:
        res = b
    elif b == c and a != b:
        res = a
    return res


def condition3(a, b, c):
    res = -1
    if a != b and a != c and b != c:
        res = abs(a + b + c - 6)

    return res


a, b, c = map(int, input().split())

print(operation(a, b, c))
0