Submission #1613441


Source Code Expand

import math

N, A, B = map(int, raw_input().split())
h = [int(raw_input()) for _ in xrange(N)]

def judge(K):
    sums = 0
    for i in h:
        t = i-K*B
        if t > 0:
            sums += math.ceil(t*1.0/(A-B))
            if sums > K:
                return False;
    return True

high = int(1e9)
low = 0

while high > low:
    mid = int((high + low) / 2)
    if judge(mid):
        high = mid;
    else:
        low = mid+1;

print low

Submission Info

Submission Time
Task D - Widespread
User kira924age
Language Python (2.7.6)
Score 400
Code Size 472 Byte
Status AC
Exec Time 886 ms
Memory 5764 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 13
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 13 ms 2820 KB
a02 AC 10 ms 2568 KB
a03 AC 10 ms 2568 KB
b04 AC 10 ms 2568 KB
b05 AC 278 ms 5764 KB
b06 AC 669 ms 5764 KB
b07 AC 582 ms 5764 KB
b08 AC 544 ms 5764 KB
b09 AC 247 ms 5764 KB
b10 AC 265 ms 5764 KB
b11 AC 309 ms 5764 KB
b12 AC 294 ms 5764 KB
b13 AC 886 ms 5764 KB