結果

問題 No.91 赤、緑、青の石
ユーザー togatoga
提出日時 2015-04-20 21:06:18
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 460 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-06-24 06:47:44
合計ジャッジ時間 1,533 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(x):
    need = 0
    rest = 0
    for i in range(3):
        if (color[i] >= x):
            rest += (color[i] - x) / 2
        else:
            need += x - color[i]
    if (rest >= need):
        return True
    else:
        return False


color = map(int, raw_input().split())

right = 1145141919810
left = 0

while (right - left > 1):
    med = (right + left) / 2
    if (check(med)):
        left = med
    else:
        right = med
print left
0