結果

問題 No.91 赤、緑、青の石
ユーザー NiER_Replicant6NiER_Replicant6
提出日時 2018-03-20 16:14:58
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 523 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2023-09-06 04:14:04
合計ジャッジ時間 8,758 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,820 KB
testcase_01 AC 16 ms
7,780 KB
testcase_02 AC 16 ms
7,784 KB
testcase_03 AC 15 ms
7,904 KB
testcase_04 AC 15 ms
7,840 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 15 ms
7,816 KB
testcase_07 AC 15 ms
7,816 KB
testcase_08 AC 16 ms
7,832 KB
testcase_09 AC 15 ms
7,888 KB
testcase_10 AC 15 ms
7,748 KB
testcase_11 AC 15 ms
7,784 KB
testcase_12 AC 16 ms
7,888 KB
testcase_13 AC 15 ms
7,892 KB
testcase_14 AC 15 ms
7,900 KB
testcase_15 AC 16 ms
7,936 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

s = list(map(int, input().split()))
def check(mid):
    total = 0
    excess=0
    lack=0
    for i in s:
        if i>=mid:
            excess=0
            lack =0
            excess = (i-mid)//2
        if i<mid:
            excess=0
            lack=0
            lack = i-mid
        total = total+excess+lack
    return total>=0

left = min(s)
right = max(s)
while True:
    mid = (left+right)//2
    if check(mid)==True:
        left = mid
    else:
        right = mid
    if right==mid+1:
        break
print(mid)
0