Submission #4666744


Source Code Expand

N, H = map(int, input().split())
A = []
B = []
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

B.sort(reverse = True)
maxA = max(A)
cnt = 0
for b in B:
    if b > maxA and H > 0:
        H -= b
        cnt += 1
        
if H > 0:
    cnt += - (- H // maxA)

print(cnt)

Submission Info

Submission Time
Task D - Katana Thrower
User Asymmetry
Language Python (3.4.3)
Score 400
Code Size 328 Byte
Status AC
Exec Time 357 ms
Memory 11348 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 4
AC × 24
Set Name Test Cases
Sample a01, a02, a03, a04
All a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 AC 17 ms 3064 KB
a02 AC 17 ms 3064 KB
a03 AC 17 ms 3060 KB
a04 AC 17 ms 3060 KB
b05 AC 17 ms 3060 KB
b06 AC 311 ms 11020 KB
b07 AC 17 ms 3064 KB
b08 AC 304 ms 10984 KB
b09 AC 17 ms 3060 KB
b10 AC 17 ms 3064 KB
b11 AC 17 ms 3060 KB
b12 AC 17 ms 3060 KB
b13 AC 299 ms 4644 KB
b14 AC 299 ms 4648 KB
b15 AC 282 ms 4620 KB
b16 AC 281 ms 4636 KB
b17 AC 341 ms 10964 KB
b18 AC 332 ms 8760 KB
b19 AC 320 ms 5036 KB
b20 AC 315 ms 5024 KB
b21 AC 357 ms 7996 KB
b22 AC 347 ms 11348 KB
b23 AC 17 ms 3060 KB
b24 AC 24 ms 3188 KB