結果

問題 No.91 赤、緑、青の石
ユーザー mkawa2mkawa2
提出日時 2020-01-03 09:51:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 790 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 11,020 KB
実行使用メモリ 8,660 KB
最終ジャッジ日時 2023-09-06 12:45:49
合計ジャッジ時間 1,889 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,464 KB
testcase_01 AC 19 ms
8,604 KB
testcase_02 AC 19 ms
8,544 KB
testcase_03 AC 18 ms
8,636 KB
testcase_04 AC 19 ms
8,460 KB
testcase_05 AC 19 ms
8,604 KB
testcase_06 AC 19 ms
8,640 KB
testcase_07 AC 19 ms
8,660 KB
testcase_08 AC 19 ms
8,548 KB
testcase_09 AC 20 ms
8,496 KB
testcase_10 AC 19 ms
8,644 KB
testcase_11 AC 18 ms
8,456 KB
testcase_12 AC 19 ms
8,624 KB
testcase_13 AC 19 ms
8,560 KB
testcase_14 AC 19 ms
8,548 KB
testcase_15 AC 19 ms
8,452 KB
testcase_16 AC 18 ms
8,564 KB
testcase_17 AC 18 ms
8,600 KB
testcase_18 AC 19 ms
8,632 KB
testcase_19 AC 19 ms
8,536 KB
testcase_20 AC 19 ms
8,460 KB
testcase_21 AC 19 ms
8,544 KB
testcase_22 AC 19 ms
8,456 KB
testcase_23 AC 18 ms
8,620 KB
testcase_24 AC 18 ms
8,628 KB
testcase_25 AC 18 ms
8,536 KB
testcase_26 AC 19 ms
8,540 KB
testcase_27 AC 19 ms
8,652 KB
testcase_28 AC 19 ms
8,452 KB
testcase_29 AC 19 ms
8,592 KB
testcase_30 AC 19 ms
8,648 KB
testcase_31 AC 18 ms
8,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    def ok(m):
        over=0
        for a in aa:
            if a>=m:
                over+=(a-m)//2
            else:
                over+=a-m
        if over>=0:return True
        return False

    aa=LI()
    l=-1
    r=sum(aa)//3+1
    while l+1<r:
        m=(l+r)//2
        if ok(m):l=m
        else:r=m
    print(l)

main()
0