結果

問題 No.91 赤、緑、青の石
ユーザー steek79
提出日時 2015-10-16 16:31:36
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 421 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 06:51:09
合計ジャッジ時間 1,321 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import ceil
ingre = map(int, raw_input().split())

ans = 0

while True:
    make = min(ingre)
    ans += make
    ingre = [i - make for i in ingre]    
    if min(ingre) == 0:
        if sum(ingre) <3: break
        else: 
            maximum = max(ingre)
            transfer = int(ceil(maximum/6.0))
            ingre[ingre.index(maximum)] -= transfer*2
            ingre[ingre.index(0)] = transfer

print ans
0