結果

問題 No.91 赤、緑、青の石
ユーザー c-yan
提出日時 2020-12-27 00:42:05
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-25 04:31:59
合計ジャッジ時間 2,069 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 24 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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