Skip to content

Instantly share code, notes, and snippets.

@qkreltms
Created March 3, 2018 14:43
Show Gist options
  • Save qkreltms/f659192f2f01966f8ade3879d98c8b7a to your computer and use it in GitHub Desktop.
Save qkreltms/f659192f2f01966f8ade3879d98c8b7a to your computer and use it in GitHub Desktop.
def baekjoon11399(length, times_to_wait_in_line):
times_to_wait_in_line.sort()
cal = sum(times_to_wait_in_line)
result = cal
for i in range(length - 1, 0, -1):
cal -= times_to_wait_in_line[i]
result += cal
return result
assert(baekjoon11399(5, [3,1,4,3,2]) == 32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment