Submission #1951069


Source Code Expand

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

a = []
b = []
for i in range(n):
    a_, b_ = input().split()
    a.append(int(a_))
    b.append(int(b_))

import numpy as np
a = np.array(a)
b = np.array(b)

to_throw = b[b>max(a)]
sum_throw = sum(to_throw)

d = h - sum_throw

if d <= 0:
    cum = np.cumsum(np.sort(b)[::-1])
    print(len(to_throw) - len(cum[cum>=h]) + 1)
else:
    import math
    print(len(to_throw) + math.ceil(d/max(a)))

Submission Info

Submission Time
Task D - Katana Thrower
User Y6I
Language Python (3.4.3)
Score 0
Code Size 466 Byte
Status WA
Exec Time 443 ms
Memory 20972 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 4
AC × 21
WA × 3
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 147 ms 12436 KB
a02 AC 147 ms 12396 KB
a03 AC 149 ms 12436 KB
a04 AC 150 ms 12440 KB
b05 AC 149 ms 12396 KB
b06 AC 429 ms 20888 KB
b07 AC 149 ms 12404 KB
b08 AC 416 ms 20888 KB
b09 AC 147 ms 12408 KB
b10 AC 176 ms 12444 KB
b11 AC 147 ms 12448 KB
b12 AC 150 ms 12408 KB
b13 AC 426 ms 14828 KB
b14 AC 417 ms 16428 KB
b15 WA 399 ms 16304 KB
b16 AC 396 ms 14780 KB
b17 AC 435 ms 20716 KB
b18 AC 417 ms 18340 KB
b19 AC 437 ms 14844 KB
b20 WA 430 ms 16244 KB
b21 WA 443 ms 17560 KB
b22 AC 438 ms 20972 KB
b23 AC 149 ms 12516 KB
b24 AC 154 ms 12536 KB