일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 라즈베리파이3b+
- NAV
- 알고리즘
- 트리
- 크롤링
- MongoDB
- node.js
- 파이썬
- 백준
- Crawling
- algotythm
- HTML
- bootstrap
- 라즈비안
- nav-tab
- Algorythm
- 라즈베리파이3
- Python
- dp
- 2579
- 라즈베리파이
- 2909
- 16.04
- springboot3.x
- 13237
- dynaminprogramming
- CSS
- raspberrypi
- ubuntu
- baekjun
Archives
- Today
- Total
노트
[백준] 18429번 근손실 python 본문
n, k = map(int, input().split())
kit = list(map(int, input().split()))
used = [0] * n
ans = 0
def dfs(a, weight):
global ans
if weight < 500:
return
if a >= n:
ans += 1
return
for i in range(n):
if used[i] == 0:
used[i] = 1
dfs(a + 1, weight + kit[i] - k)
used[i] = 0
dfs(0, 500)
print(ans)
'알고리즘' 카테고리의 다른 글
[백준] 2606번 바이러스 python (0) | 2023.07.09 |
---|---|
[백준] 2644번 촌수계산 python (0) | 2023.07.01 |
[백준] 14267번 회사 문화 1 python (0) | 2023.06.17 |
[백준] 28224번 Final Price python (0) | 2023.06.17 |
[백준] 27962번 오렌지먹은지오랜지 python (0) | 2023.06.09 |
Comments