https://www.acmicpc.net/problem/11399
[Code]
n=int(input())
sums=0
arr=list(map(int, input().split()))
for i in range(n):
for j in range(i+1,n):
if arr[i]>arr[j]:
arr[i],arr[j]= arr[j],arr[i]
for i in range(1,n+1):
sums += sum(arr[0:i])
print(sums)
'๐ฏ์๊ณ ๋ฆฌ์ฆ > BOJ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค/Python] 11051:์ดํญ ๊ณ์ 2 (0) | 2024.06.27 |
---|---|
[๋ฐฑ์ค/Python] 2748:ํผ๋ณด๋์น ์ 2 (0) | 2024.06.27 |
4-3 ์ฝ์ ์ ๋ ฌ (0) | 2023.07.01 |
4-2 ์ ํ ์ ๋ ฌ (1) | 2023.07.01 |
4-1 ๋ฒ๋ธ ์ ๋ ฌ (0) | 2023.07.01 |