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 |
Tags
- jwttoken
- 항해99
- 빈 조회 2개 이상
- 빈 충돌
- 커스텀 헤더
- JavaScript
- KPT회고
- 취업리부트코스
- infcon 2024
- 파이썬
- Spring multimodule
- jwt
- 1주일회고
- 단기개발자코스
- 프로그래머스
- @FeignClient
- 개발자 취업
- DesignPattern
- 인프콘 2024
- 구글 OAuth login
- Python
- 전략패턴 #StrategyPattern #디자인패턴
- 코딩테스트 준비
- 디자인패턴
- 99클럽
- 개발자부트캠프추천
- TiL
- 디자인 패턴
- spring batch 5.0
- 프로그래머스 이중우선순위큐
Archives
- Today
- Total
목록백준 #1182 #부분수열의합 #파이썬 #python (1)
m1ndy5's coding blog
[수학] 백준 1182번 부분수열의 합 with python
https://www.acmicpc.net/problem/1182 n, s = map(int, input().split()) lst = list(map(int, input().split())) pair = [] cnt = 0 def btracking(start): global cnt if sum(pair) == s and len(pair) > 0: cnt += 1 for i in range(start, n): pair.append(lst[i]) btracking(i + 1) pair.pop() btracking(0) print(cnt) 저번에 풀었던 n과m과 다르게 [1, 3]과 [3, 1]은 똑같다고 보는 중복을 허용하지 않는 combination문제였다. 코드의 차이점은 중복을 허용했던 permuta..
알고리즘 with python/수학
2023. 3. 12. 15:43