結果

問題 No.91 赤、緑、青の石
ユーザー kobikikobiki
提出日時 2016-03-13 10:46:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 664 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 81,696 KB
実行使用メモリ 53,444 KB
最終ジャッジ日時 2023-10-26 03:18:01
合計ジャッジ時間 2,480 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

class Solve:
    def __init__(self):
        self.S = [int(i) for i in input().split()]

        self.a = min(self.S) # >= 0; True
        self.b = max(self.S)+1  # <= 10**7+1; False

    def solve(self):
        S = sorted(self.S)
        n = S.pop(0)
        S0, S1 = [s-n for s in S]

        # S0とS1を同じ数にしようとする
        d = (S1 - S0)//2
        # S0とS1を同じ数又は1個差にできる場合
        if S0 >= S1//3:
            n += (S0 + S1)//4 - int(S0 - d == S1 - 3*d == 2)
        # 先にS0枯渇 && 残りのS1が5個で1個生成
        else:
            n += S0 + (S1 - 3*S0)//5

        return n

print(Solve().solve())
0