結果

問題 No.91 赤、緑、青の石
ユーザー 👑 KazunKazun
提出日時 2020-05-31 19:02:40
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 486 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 81,792 KB
最終ジャッジ日時 2024-04-29 07:26:36
合計ジャッジ時間 4,562 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 41 ms
51,840 KB
testcase_07 AC 42 ms
51,712 KB
testcase_08 AC 40 ms
51,840 KB
testcase_09 AC 40 ms
51,840 KB
testcase_10 AC 41 ms
51,456 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 40 ms
51,584 KB
testcase_17 AC 40 ms
51,968 KB
testcase_18 AC 41 ms
51,840 KB
testcase_19 AC 40 ms
51,840 KB
testcase_20 AC 41 ms
51,840 KB
testcase_21 AC 41 ms
51,584 KB
testcase_22 AC 40 ms
51,840 KB
testcase_23 AC 41 ms
51,840 KB
testcase_24 AC 40 ms
51,456 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 40 ms
51,968 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 40 ms
51,840 KB
testcase_31 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(X,Y,Z):
    if X+Y+Z<=2:
        return 0
    elif X*Y*Z!=0:
        M=min(X,Y,Z)
        return M+f(X-M,Y-M,Z-M)
    else:
        H=[X,Y,Z]
        H.sort(reverse=True)

        a,b,c=tuple(H)

        if a+b<=3:
            return 0
        
        if a==b:
            return f(a-2,b,1)
        elif b==0:
            return a//5
        else:
            h=min((a-b+1)//2,b+1)
            return f(a-3*h,b-h,0)+h
            

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