Submission #4026573


Source Code Expand

N,A,B=map(int, raw_input().split()) 
H=[ input() for i in range(N) ] 

def func(n , T):

	S=[]
	for x in T:
		x-=n*B
		if x>0:
			S.append(x)

	sa=A-B
	for x in S:
		if x%sa==0:
			n-=x/sa
		else:
			n-=(x/sa+1)
		if n<0:
			return False
	else:
			return True

l=0
r=10**15
while l!=r:
	m=(r+l)/2
	if func(m,H):
		r=m
	else:
		l=m+1

print l

Submission Info

Submission Time
Task D - Widespread
User KUMAWO
Language PyPy2 (5.6.0)
Score 0
Code Size 372 Byte
Status TLE
Exec Time 2109 ms
Memory 83356 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 4
TLE × 9
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 46 ms 26732 KB
a02 AC 37 ms 26476 KB
a03 AC 38 ms 27628 KB
b04 AC 38 ms 27628 KB
b05 TLE 2108 ms 71068 KB
b06 TLE 2108 ms 71896 KB
b07 TLE 2108 ms 71836 KB
b08 TLE 2108 ms 70940 KB
b09 TLE 2108 ms 72684 KB
b10 TLE 2107 ms 72752 KB
b11 TLE 2108 ms 72604 KB
b12 TLE 2102 ms 76572 KB
b13 TLE 2109 ms 83356 KB