Submission #1950126


Source Code Expand

n, h = map(int, input().split())

a = []
b = []

for i in range(n):
  x, y = map(int, input().split())
  a.append(x)
  b.append(y)

max_a = max(a)

ans = 0
for x in reversed(sorted(filter(lambda x: x >= max_a, b))):
  h -= x
  ans += 1
  if h <= 0: break

ans += max(0, (h + max_a - 1) // max_a)
print(ans)

Submission Info

Submission Time
Task D - Katana Thrower
User pekempey
Language PyPy3 (2.4.0)
Score 400
Code Size 329 Byte
Status AC
Exec Time 636 ms
Memory 65880 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 166 ms 38384 KB
a02 AC 165 ms 38256 KB
a03 AC 166 ms 38256 KB
a04 AC 166 ms 38256 KB
b05 AC 165 ms 38256 KB
b06 AC 636 ms 63064 KB
b07 AC 166 ms 38256 KB
b08 AC 581 ms 60760 KB
b09 AC 164 ms 38256 KB
b10 AC 167 ms 38256 KB
b11 AC 166 ms 38256 KB
b12 AC 166 ms 38384 KB
b13 AC 566 ms 60504 KB
b14 AC 632 ms 65880 KB
b15 AC 601 ms 65880 KB
b16 AC 616 ms 65880 KB
b17 AC 568 ms 56024 KB
b18 AC 564 ms 56024 KB
b19 AC 564 ms 60632 KB
b20 AC 559 ms 59480 KB
b21 AC 589 ms 60376 KB
b22 AC 582 ms 60632 KB
b23 AC 166 ms 38256 KB
b24 AC 256 ms 42224 KB