반응형
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
- 컴퓨터 비전
- recommender system
- 파이썬
- Unsupervised learning
- 인공지능
- logistic regression
- 신경망
- 백준
- C++
- 딥러닝
- petal to metal
- Support Vector Machine
- Computer Vision
- 그래픽스
- 추천 시스템
- 로지스틱 회귀
- CNN
- Vision
- Kaggle
- 머신러닝
- SVM
- 비용함수
- neural network
- pre-trained
- Regularization
- OpenGL
- SGD
- cs231n
- 컴퓨터 그래픽스
- CPP
Archives
- Today
- Total
kwan's note
백준-15649번 N과 M (2) 파이썬 (python code) 본문
반응형
문제번호:15650
난이도: 실버3
기존 1번문제에서
reminder-by-kwan.tistory.com/47 길이가 이전숫자보다 새로 들어오는 숫자가 커야한다는 조건을 추가하였다
from sys import stdin
def dfs(cnt):
if cnt == M:
print(*answer)
return
for i in range(N):
if (checkist[i]==False and (numlist[i]>answer[len(answer)-1 ]if len(answer) >0 else 1)):
checkist[i]=True
answer.append(numlist[i])
dfs(cnt+1)
answer.pop()
checkist[i]=False
if __name__ == '__main__':
N,M= map(int,stdin.readline().split())
answer=[]
checkist=[False]*N
numlist=[i+1 for i in range(N)]
dfs(0)
반응형
'Algorithm > python' 카테고리의 다른 글
백준 9633번 NQueen 파이썬 (python code) (0) | 2021.01.12 |
---|---|
백준 15649번 N과 M (3) 파이썬 (python code) (0) | 2021.01.12 |
백준-2108번 통계학 파이썬 (python code) (0) | 2021.01.12 |
백준-15649번 N과 M (1) 파이썬 (python code) (0) | 2021.01.12 |
백준-11399번 ATM 파이썬 (python code) (0) | 2021.01.10 |