結果

問題 No.91 赤、緑、青の石
ユーザー koyoprokoyopro
提出日時 2015-09-20 20:36:42
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 628 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 6,504 KB
実行使用メモリ 10,424 KB
最終ジャッジ日時 2023-09-26 14:04:53
合計ジャッジ時間 31,371 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,901 ms
10,424 KB
testcase_01 AC 1,924 ms
5,984 KB
testcase_02 AC 149 ms
5,932 KB
testcase_03 AC 2,396 ms
5,936 KB
testcase_04 AC 1,027 ms
5,928 KB
testcase_05 AC 2,257 ms
5,884 KB
testcase_06 AC 11 ms
5,848 KB
testcase_07 AC 11 ms
5,856 KB
testcase_08 AC 11 ms
5,936 KB
testcase_09 AC 11 ms
5,992 KB
testcase_10 AC 11 ms
5,936 KB
testcase_11 AC 80 ms
5,848 KB
testcase_12 AC 1,609 ms
5,924 KB
testcase_13 AC 3,964 ms
5,932 KB
testcase_14 AC 873 ms
5,856 KB
testcase_15 AC 3,153 ms
6,040 KB
testcase_16 AC 11 ms
6,044 KB
testcase_17 AC 11 ms
5,852 KB
testcase_18 AC 11 ms
5,928 KB
testcase_19 AC 11 ms
5,852 KB
testcase_20 AC 11 ms
5,936 KB
testcase_21 AC 11 ms
5,960 KB
testcase_22 AC 11 ms
5,936 KB
testcase_23 AC 11 ms
6,100 KB
testcase_24 AC 11 ms
5,856 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

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

# 普通に作れる数
minc = min(R, G, B)

R -= minc
G -= minc
B -= minc

# 2番目の多いやつを基準に考える
l = sorted([R, G, B])
while True:
    if l[1] > 0:
        # 2種類ある場合
        amari = l[2] - l[1]
        add = max(min(l[1], amari/2), 1)
        if l[2]-add*3 < 0: break
        minc += add
        l[1] -= add
        l[2] -= add*3
        #if sum(l) <= 4: break
    else:
        # 1種類しか残ってない場合
        add = l[2] / 5
        minc += add
        l[2] -= add*5
        break
    l = sorted(l)

print minc
0