Submission #5031859


Source Code Expand

n,a,b = map(int,input().split())

h = []
for i in range(n):
    h.append(int(input()))
st,ed = 0,10**9+1
hc = [0]*n
while st<ed-1:
    mid = (st+ed)//2
    #print(mid)
    tmp = 0
    for i in range(n):
        hc[i]=h[i]-mid*b
    for i in range(n):
        if hc[i]>0:
            tmp+=(hc[i]//(a-b))+(hc[i]%(a-b)>0)
    if tmp<=mid:
        ed = mid
    else:
        st = mid
print(ed) 

Submission Info

Submission Time
Task D - Widespread
User Ruloch
Language Python (3.4.3)
Score 0
Code Size 412 Byte
Status TLE
Exec Time 2104 ms
Memory 11044 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 12
TLE × 1
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 17 ms 3064 KB
a02 AC 17 ms 3064 KB
a03 AC 17 ms 3064 KB
b04 AC 17 ms 3064 KB
b05 AC 1149 ms 11036 KB
b06 TLE 2104 ms 11036 KB
b07 AC 1595 ms 11036 KB
b08 AC 1348 ms 11036 KB
b09 AC 1170 ms 11036 KB
b10 AC 1141 ms 11036 KB
b11 AC 1123 ms 11036 KB
b12 AC 1179 ms 11044 KB
b13 AC 1809 ms 11032 KB