結果

問題 No.91 赤、緑、青の石
ユーザー yuushi narazaki
提出日時 2025-03-07 15:08:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 735 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 82,672 KB
実行使用メモリ 54,280 KB
最終ジャッジ日時 2025-03-07 15:08:57
合計ジャッジ時間 3,395 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 21 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

R,G,B = map(int,input().split())

left = 0
right = 10**9 + 1

ans = 0

def search(mid,R,G,B):
    count = 0
    count += min(R,G,B)
    R -= count
    G -= count
    B -= count
    s = 0
    if(R != 0 and R % 2 == 0):
        s += 1
    if(G != 0 and B % 2 == 0):
        s += 1 
    if(B != 0 and B % 2 == 0):
        s += 1   
    t = R + G + B
    if(s != 2 or s != 0):
        count += t // 4
    else:
        if((t//4) % 2 != s % 2):
            count += (t // 4) - 1
        else:
            count += t // 4
    return count        



while abs(left - right) > 1:
    mid = (left + right) // 2
    if(search(mid,R,G,B) >= mid):
        left = mid
        ans = max(ans,mid)
    else:
        right = mid   
print(ans)         
0