프로그래밍/HackerRank
[HackerRank][Python3] Marc's Cakewalk
snoopybox
2018. 6. 6. 01:13
Problem :
https://www.hackerrank.com/challenges/marcs-cakewalk/problem
My Solution :
#!/usr/bin/env python3 def marcsCakewalk(n, calorie): calorie = sorted(calorie, reverse=True) return sum([calorie[i]*(2**i) for i in range(n)]) n = int(input()) calorie = list(map(int, input().strip().split())) result = marcsCakewalk(n, calorie) print(result)