restructure zeta/** to storage/zeta/**
This commit is contained in:
19
storage/zeta/py/completed/28357.py
Normal file
19
storage/zeta/py/completed/28357.py
Normal file
@@ -0,0 +1,19 @@
|
||||
def X(N, K, A) -> int:
|
||||
A.sort()
|
||||
start = 0
|
||||
end = max(A)
|
||||
mid = start
|
||||
while start < end:
|
||||
mid = (start + end) // 2
|
||||
w = sum(x - mid for x in A if x > mid)
|
||||
if w > K:
|
||||
start = mid + 1
|
||||
else:
|
||||
end = mid
|
||||
return start
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
N, K = map(int, input().split())
|
||||
A = list(map(int, input().split()))
|
||||
print(X(N, K, A))
|
||||
Reference in New Issue
Block a user