반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 수학
- level3
- DP
- level2
- 다익스트라
- 딕셔너리
- 파이썬
- level1
- 에라스토테네스의 체
- 브루트포스
- 운영체제
- 코딩테스트
- level0
- MYSQL
- programmers
- 재귀
- python
- BOJ
- 힙
- 다이나믹 프로그래밍
- dfs
- BFS
- 백준
- 스택
- N과M
- 가상메모리
- 프로그래머스
- 구현
- 그리디
- 가상메모리 관리
Archives
- Today
- Total
목록1182 (1)
동캄의 코딩도장
백준 1182 [부분수열의 합]
https://www.acmicpc.net/problem/1182# 백준 1182 부분수열의 합N,S=map(int,input().split())lst=list(map(int,input().split()))lst.sort() #정렬ans=0 #정답def search(start): global ans if s and sum(s)==S: #S와 부분집합의 합이 같다면 ans+=1 #정답 갯수 증가 for i in range(start,N): if visit[i]==0: #방문하지 않았다면 s.append(lst[i]) #배열에 추가 visit[i]=1 #방문확인 search(i) #재귀적으로 탐색하되, 이전에..
코테/BOJ
2025. 3. 3. 21:24