結果

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

ソースコード

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:
            t += (f-s) // 2
            f -= f - s
        else:
            t = (f//2)//2 + (s//2)//2
            f -= f // 2
            s -= s // 2
    R,G,B = f,s,t

print(total) 
0