結果

問題 No.91 赤、緑、青の石
ユーザー ynyn
提出日時 2016-09-30 00:42:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 340 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 71,636 KB
最終ジャッジ日時 2023-09-06 12:23:34
合計ジャッジ時間 3,983 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,368 KB
testcase_01 AC 70 ms
71,376 KB
testcase_02 AC 67 ms
71,160 KB
testcase_03 AC 68 ms
71,472 KB
testcase_04 AC 68 ms
71,348 KB
testcase_05 AC 69 ms
71,536 KB
testcase_06 AC 64 ms
71,124 KB
testcase_07 AC 67 ms
71,636 KB
testcase_08 AC 70 ms
71,540 KB
testcase_09 AC 70 ms
71,436 KB
testcase_10 AC 67 ms
71,588 KB
testcase_11 AC 65 ms
71,436 KB
testcase_12 AC 67 ms
71,504 KB
testcase_13 AC 68 ms
71,556 KB
testcase_14 AC 67 ms
71,384 KB
testcase_15 AC 64 ms
71,388 KB
testcase_16 AC 69 ms
71,368 KB
testcase_17 AC 67 ms
71,548 KB
testcase_18 AC 71 ms
71,176 KB
testcase_19 AC 70 ms
71,312 KB
testcase_20 AC 68 ms
71,564 KB
testcase_21 AC 71 ms
71,452 KB
testcase_22 AC 69 ms
71,588 KB
testcase_23 AC 69 ms
71,456 KB
testcase_24 AC 68 ms
71,276 KB
testcase_25 AC 68 ms
71,364 KB
testcase_26 AC 67 ms
71,628 KB
testcase_27 AC 69 ms
71,276 KB
testcase_28 AC 68 ms
71,624 KB
testcase_29 AC 65 ms
71,436 KB
testcase_30 AC 67 ms
71,368 KB
testcase_31 AC 66 ms
71,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

rgb = list(map(int,input().split()))

l = 0
r = 10 ** 8

for i in range(100):
    rgb.sort()
    m = (l + r) // 2

    add = 0
    need = 0

    for j in range(3):
        if rgb[j] >= m:
            add += (rgb[j] - m) // 2
        else:
            need += (m - rgb[j])

    if need <= add:
        l = m
    else:
        r = m

print(m)
0