Skip to content

Instantly share code, notes, and snippets.

@cocodrips
Last active December 31, 2015 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cocodrips/8000891 to your computer and use it in GitHub Desktop.
Save cocodrips/8000891 to your computer and use it in GitHub Desktop.
SRM600 Div2 Easy
class TheShuttles:
def getLeastCost(self, cnt, baseCost, seatCost):
cnt = list(cnt)
m = max(cnt)
mini = 100000000000
for i in xrange(1, m + 1):
sum = 0
for c in cnt:
sum += (baseCost + (seatCost * i)) * math.ceil(float(c) / i)
mini = min(mini, sum)
return mini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment