Marc's Cakewalk

  • + 1 comment

    You can one-line this beauty like this :

    input(), print(sum(c * 2 ** j for (j, c) in enumerate(sorted(map(int, input().split()), reverse=True))))