Submission #4678087


Source Code Expand

from operator import itemgetter
n,h = map(int,input().split())

info = [list(map(int,input().split())) for i in range(n)]

maxFuru = max(list(zip(*info))[0])


nageru = []
for i in range(n):
  if info[i][1] > maxFuru:
    nageru.append(info[i][1])
nageru = sorted(nageru)

nokori = h
ans = 0

while nokori>0:
  if nageru:
    nokori -= nageru[-1]
    del nageru[-1]
    ans += 1
  else:
    ans += -((-nokori)//maxFuru)
    nokori = 0

print(ans)

Submission Info

Submission Time
Task D - Katana Thrower
User neterukun
Language Python (3.4.3)
Score 400
Code Size 472 Byte
Status AC
Exec Time 434 ms
Memory 36084 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 18 ms 3064 KB
a03 AC 18 ms 3064 KB
a04 AC 17 ms 3064 KB
b05 AC 18 ms 3064 KB
b06 AC 364 ms 36084 KB
b07 AC 18 ms 3064 KB
b08 AC 364 ms 36084 KB
b09 AC 17 ms 3064 KB
b10 AC 17 ms 3064 KB
b11 AC 17 ms 3064 KB
b12 AC 17 ms 3064 KB
b13 AC 386 ms 29684 KB
b14 AC 378 ms 29684 KB
b15 AC 346 ms 29684 KB
b16 AC 346 ms 29684 KB
b17 AC 346 ms 35768 KB
b18 AC 362 ms 33444 KB
b19 AC 395 ms 29684 KB
b20 AC 400 ms 29756 KB
b21 AC 434 ms 32736 KB
b22 AC 425 ms 36012 KB
b23 AC 18 ms 3064 KB
b24 AC 25 ms 3700 KB