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
- 백준 16235
- 백준 16236
- 백준
- 백준 15685
- 프로래머스
- 백준 19238
- 백준 17779
- spring security
- 백준 17626
- 파이썬
- MySQL
- spring oauth
- 백준 파이썬
- 백준 16719
- Coroutine
- Spring Boot
- Kotlin
- MSA
- springboot
- java 기술면접
- with recursive
- JVM
- 프로그래머스
- spring cloud
- java
- JPA
- sql 기술면접
- 웹어플리케이션 서버
- re.split
- Spring
Archives
- Today
- Total
목록백준 15654 (1)
시작이 반
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/bwqWmV/btqS4MuZBXT/VmlIospKYCi434OusXo0a0/img.png)
N과 M 5번 문제는 1부터 n까지 숫자가 있는 것이 아니라 입력으로 n개의 숫자를 임의로 받는다. 이를 list형태로 저장하고 숫자가 작은 것부터 탐색을 해야 하기 때문에 오름차순으로 정렬을 한다. 이후는 기존 n과 m의 풀이 방법과 같다. 대신 반복문의 i를 solve 리스트에 append, pop 하는 것이 아닌 오름차순으로 정렬한 리스트의 i번째 값을 append, pop 한다. n, m = map(int, input().split()) my_list = list(map(int, input().split())) my_list.sort() solve = [] visited = [False] * n def Dfs(depth): if depth == m: print(' '.join(map(str, so..
알고리즘/백준
2021. 1. 10. 18:17