[HackerRank][Python3] Marc's Cakewalk
2018. 6. 6. 01:13 |
프로그래밍/HackerRank
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)
'프로그래밍 > HackerRank' 카테고리의 다른 글
| [HackerRank][Python3] Two Characters (0) | 2018.06.11 |
|---|---|
| [HackerRank][Python3] Append and Delete (0) | 2018.06.10 |
| [HackerRank][Python3] Recursive Digit Sum (0) | 2018.06.07 |
| [HackerRank][Python3] Sam and substrings (0) | 2018.06.06 |
| [HackerRank][Python3] Minimum Loss (0) | 2018.06.05 |
| [HackerRank][Python3] Strong Password (0) | 2018.06.05 |
| [HackerRank][Python3] Climbing the Leaderboard (0) | 2018.06.01 |
| [HackerRank][Python3] The Power Sum (1) | 2018.05.31 |
최근에 달린 댓글 최근에 달린 댓글