結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー flippergo
提出日時 2020-12-28 18:11:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 507 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 192 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 54,032 KB
最終ジャッジ日時 2025-12-07 12:37:55
合計ジャッジ時間 2,259 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

R,G,B = map(int,input().split())
high = 10**7+1
low = 0
while high-low>1:
    mid = (high+low)//2
    x,y,z = R,G,B
    x -= mid
    y -= mid
    z -= mid
    if x<0 and y<0 and z<0:
        high = mid
        continue
    x,y,z = sorted([x,y,z])
    if y>=0:
        cnt = y//2+z//2
        if x+cnt>=0:
            low = mid
            continue
        high = mid
        continue
    else:
        if x+y+z//2>=0:
            low = mid
            continue
        high = mid
        continue
print(low)
0