結果

問題 No.91 赤、緑、青の石
ユーザー zombietanzombietan
提出日時 2016-05-16 14:54:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 694 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,832 KB
実行使用メモリ 8,340 KB
最終ジャッジ日時 2023-09-06 12:21:06
合計ジャッジ時間 2,007 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,248 KB
testcase_01 AC 16 ms
8,200 KB
testcase_02 AC 16 ms
8,156 KB
testcase_03 AC 16 ms
8,160 KB
testcase_04 AC 16 ms
8,192 KB
testcase_05 AC 16 ms
8,144 KB
testcase_06 AC 138 ms
7,928 KB
testcase_07 AC 15 ms
7,872 KB
testcase_08 AC 16 ms
8,312 KB
testcase_09 AC 16 ms
7,796 KB
testcase_10 AC 16 ms
8,268 KB
testcase_11 AC 16 ms
8,244 KB
testcase_12 AC 16 ms
8,268 KB
testcase_13 AC 16 ms
8,316 KB
testcase_14 AC 16 ms
8,132 KB
testcase_15 AC 16 ms
8,264 KB
testcase_16 AC 16 ms
7,884 KB
testcase_17 AC 16 ms
7,888 KB
testcase_18 AC 16 ms
7,824 KB
testcase_19 AC 16 ms
8,236 KB
testcase_20 AC 16 ms
8,304 KB
testcase_21 AC 16 ms
7,800 KB
testcase_22 AC 16 ms
7,968 KB
testcase_23 AC 16 ms
8,304 KB
testcase_24 AC 16 ms
8,300 KB
testcase_25 AC 15 ms
8,160 KB
testcase_26 AC 16 ms
8,196 KB
testcase_27 AC 16 ms
7,836 KB
testcase_28 AC 16 ms
7,876 KB
testcase_29 AC 32 ms
7,876 KB
testcase_30 AC 16 ms
8,340 KB
testcase_31 AC 16 ms
8,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

r,g,b = map(int, input().split())
s = sorted([r,g,b])
c = 0
if s[0] != 0:
    a = min(s)
    s = [0, s[1]-a, s[2]-a]
    c = a

if s[1] >= 1 and s[2] >= 3:
    sa = s[2] - s[1]
    x, y = divmod(sa, 2)
    if x <= s[1]:
        c = c + x
        s[1] = s[1] - x
        s[2] = s[2] - (3*x)
        if s[1] == s[2]:
            k, j = divmod(s[1], 4)
            c = c + k*2 + j//3
            print(c)
            exit()
        else:
            k, j = divmod(s[1], 4)
            c = c + k*2 + j//2
            print(c)
            exit()
    else:
        while s[1] >= 1 and s[2] >= 3:
            s[2] -=  3
            s[1] -=  1
            c += 1
        
d = s[2]//5
c = c + d
print(c)
0