結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー steek79
提出日時 2015-10-16 16:31:36
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 87 ms / 5,000 ms
コード長 421 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 138 ms
コンパイル使用メモリ 77,720 KB
実行使用メモリ 76,552 KB
最終ジャッジ日時 2025-12-07 12:23:33
合計ジャッジ時間 4,232 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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