結果

問題 No.91 赤、緑、青の石
ユーザー NiER_Replicant6NiER_Replicant6
提出日時 2018-03-20 16:22:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 582 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 12,684 KB
最終ジャッジ日時 2023-09-06 04:52:20
合計ジャッジ時間 7,603 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,820 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 16 ms
7,848 KB
testcase_03 AC 15 ms
7,916 KB
testcase_04 AC 15 ms
7,820 KB
testcase_05 AC 15 ms
8,000 KB
testcase_06 AC 16 ms
7,836 KB
testcase_07 AC 15 ms
7,864 KB
testcase_08 AC 15 ms
7,952 KB
testcase_09 AC 15 ms
7,852 KB
testcase_10 AC 15 ms
7,916 KB
testcase_11 AC 15 ms
7,908 KB
testcase_12 AC 15 ms
7,816 KB
testcase_13 AC 15 ms
7,980 KB
testcase_14 AC 16 ms
7,864 KB
testcase_15 AC 16 ms
7,916 KB
testcase_16 AC 16 ms
7,812 KB
testcase_17 TLE -
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:
    if left==0 and right==0:
        mid = 0
        break
    mid = (left+right)//2
    if check(mid)==True:
        left = mid
    else:
        right = mid
    if right==mid+1:
        break
print(mid)
0