結果

問題 No.91 赤、緑、青の石
ユーザー takeshiD
提出日時 2020-03-07 11:44:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-24 07:24:40
合計ジャッジ時間 2,130 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

def c(x):
    # x個作ることが可能か
    global R, G, B
    ret = 0
    for a in (R, G, B):
        if a>=x:
            ret += (a-x)//2
        else:
            ret += a-x
    return ret>=0

R, G, B = map(int, input().split())
inf = 0
sup = 10**9
while sup-inf>1:
    mid = (inf+sup)//2
    if c(mid):
        inf = mid
    else:
        sup = mid
print(inf)
0