結果

問題 No.91 赤、緑、青の石
ユーザー nbisco
提出日時 2016-08-31 23:27:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-14 13:45:22
合計ジャッジ時間 2,318 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

R, G, B = [int(i) for i in input().strip().split(" ")]
total = 0
m = 0

while True:
    if R * G * B != 0:
        m = min(R,G,B)
        R -= m
        G -= m
        B -= m
    total += m
    f, s, t = sorted([R,G,B], reverse=True)
    if s == t:
        if f < 5:
            break
        s = (f - f // 4) // 2
        t = s
        tmp = f - t - s 
        f = f//4 + tmp
    else:
        if f < 3:
            break
        if f - s > 1:
            t = (f-s) // 2
            f -= f - s - (f-s-t*2)
        else:
            t = (f//2)//2 + (s//2)//2
            f -= f // 2
            s -= s // 2
    R,G,B = f,s,t

print(total) 
0