結果

問題 No.91 赤、緑、青の石
ユーザー c-yanc-yan
提出日時 2020-12-27 00:42:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 11,944 KB
実行使用メモリ 10,076 KB
最終ジャッジ日時 2023-10-25 09:26:33
合計ジャッジ時間 2,472 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

R, G, B = map(int, input().split())

a = [R, G, B]


def is_ok(n):
    m = 0
    p = 0
    for x in a:
        if x - n >= 0:
            p += x - n
        else:
            m += n - x
    return p >= m * 2


ok = 0
ng = max(a) + 1
while ng - ok > 1:
    m = ok + (ng - ok) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)
0