일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 2909
- NAV
- dynaminprogramming
- 라즈베리파이
- Crawling
- 크롤링
- dp
- raspberrypi
- 라즈베리파이3
- 16.04
- Python
- 트리
- 라즈베리파이3b+
- HTML
- bootstrap
- MongoDB
- 2579
- ubuntu
- Algorythm
- springboot3.x
- nav-tab
- CSS
- 파이썬
- 백준
- 라즈비안
- baekjun
- algotythm
- 13237
- 알고리즘
- node.js
Archives
- Today
- Total
노트
[백준] 15903번 카드 합체 놀이 python 본문
n,m = map(int,input().split())
cards = list(map(int,input().split()))
ans = 0
for i in range(m):
cards.sort()
temp = cards[0]+cards[1]
cards[0] = cards[1] = temp
for j in range(n):
ans += cards[j]
print(ans)
'알고리즘' 카테고리의 다른 글
[백준] 2579번 계단 오르기 python (0) | 2023.09.22 |
---|---|
[백준] 1991번 트리 순회 python (0) | 2023.09.12 |
[백준] 1197번 최소 스패닝 트리 python (0) | 2023.08.20 |
[백준] 2775번 부녀회장이 될테야 python (0) | 2023.08.13 |
[백준] 5567번 결혼식 python (0) | 2023.07.30 |
Comments