목차

슬라임 합치기

ps
링크acmicpc.net/…
출처BOJ
문제 번호14241
문제명슬라임 합치기
레벨실버 3
분류

애드혹

시간복잡도O(n)
인풋사이즈n<=100
사용한 언어Python 3.13
제출기록32412KB / 32ms
최고기록32ms
해결날짜2026/03/04

풀이

코드

"""Solution code for "BOJ 14241. 슬라임 합치기".

- Problem link: https://www.acmicpc.net/problem/14241
- Solution link: http://www.teferi.net/ps/problems/boj/14241

Tags: [ad hoc]
"""


def main():
    _N = int(input())
    slimes = [int(x) for x in input().split()]

    answer = 0
    size = 0
    for s in slimes:
        answer += size * s
        size += s
    print(answer)


if __name__ == '__main__':
    main()