結果

問題 No.91 赤、緑、青の石
ユーザー sue_charosue_charo
提出日時 2017-08-07 00:26:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 988 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-20 04:38:28
合計ジャッジ時間 11,443 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 26 ms
10,752 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 25 ms
10,752 KB
testcase_10 AC 25 ms
10,752 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 26 ms
10,752 KB
testcase_17 AC 26 ms
10,752 KB
testcase_18 AC 25 ms
10,752 KB
testcase_19 AC 25 ms
10,752 KB
testcase_20 WA -
testcase_21 AC 24 ms
10,752 KB
testcase_22 AC 25 ms
10,880 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))


def read():
    R, G, B = ILI()
    return R, G, B


def solve(R, G, B):
    min_all = min(R, G, B)
    l_dif = [ele - min_all for ele in [R, G, B]]
    l_dif.sort(reverse=True)
    dif_1 = l_dif[0]
    dif_2 = l_dif[1]

    ans = min_all
    if dif_1 >= dif_2 * 3:
        ans += dif_2
        ans += (dif_1 - dif_2) // 5
    else:
        div, mod = divmod((dif_1 - dif_2), 2)
        ans += div
        dif_1 = dif_2 + mod - div
        dif_2 = dif_2 - div
        state = 0
        while dif_1 >= 3 or dif_2 >= 3:
            if state == 0:
                dif_1 -= 3
                dif_2 -= 1
            elif state == 1:
                dif_1 -= 3
                dif_2 -= 1
            ans += 1
            state = (state + 1) % 2

    return ans


def main():
    params = read()
    print(solve(*params))


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