Submission #1613435


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 = math.ceil(max(h)/B)
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 0
Code Size 483 Byte
Status WA
Exec Time 846 ms
Memory 5764 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 12
WA × 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 15 ms 2820 KB
a02 AC 11 ms 2568 KB
a03 AC 11 ms 2568 KB
b04 AC 11 ms 2692 KB
b05 WA 107 ms 5764 KB
b06 AC 642 ms 5764 KB
b07 AC 697 ms 5764 KB
b08 AC 668 ms 5764 KB
b09 AC 258 ms 5764 KB
b10 AC 210 ms 5764 KB
b11 AC 252 ms 5764 KB
b12 AC 238 ms 5764 KB
b13 AC 846 ms 5764 KB