結果

問題 No.1934 Four Fruits
ユーザー 加藤優太加藤優太
提出日時 2022-05-13 21:51:51
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 695 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 7,876 KB
最終ジャッジ日時 2023-09-29 07:01:13
合計ジャッジ時間 982 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,764 KB
testcase_01 AC 18 ms
7,756 KB
testcase_02 AC 17 ms
7,804 KB
testcase_03 AC 16 ms
7,876 KB
testcase_04 AC 16 ms
7,804 KB
testcase_05 AC 16 ms
7,752 KB
testcase_06 AC 16 ms
7,796 KB
testcase_07 AC 16 ms
7,736 KB
testcase_08 AC 16 ms
7,764 KB
testcase_09 AC 16 ms
7,764 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