
# 직접 작성한 코드 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 31 32 N, M = map(int, input().split()) check_list = [False]*N num_list = [i for i in range(1,N+1)] output = [] result = [] def permutation(count): if count == M: if [*check_list] not in result: result.append([*check_list]) return for i in range(N): if check_list[i] == True: continue output.append(num_lis..

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 N, M = map(int, input().split()) check_list = [False]*N num_list = [i for i in range(1,N+1)] output = [] def permutation(count): if count == M: print(*output) return for i in range(N): if check_list[i] == True: continue output.append(num_list[i]) check_list[i] = True permutation(count+1) output.pop() check_list[i] = False permutation(0)..
1. 클릭하여 여러 개의 커서 만들기 : alt + 마우스 왼쪽 클릭 2. 드래그하여 여러개의 커서 만들기 : shift + alt + 마우스 드래그 3. 여러 개의 문장 끝에 커서 만들기 : 여러 개의 문장 드래그 후 shift + alt + i 4. 여러 개의 문장을 주석 처리 : shifh + / 5. 한 라인 삭제 : ctrl + shift + k 6. 라인 위로 올리기 또는 아래로 내리기 : alt + up or alt + down 7. 라인 복사하기 : shift + alt + up or shift + alt + down 8. 특정 단어 연속으로 블록지정하기 : ctrl + D 9. 코드 맨 위로 또는 맨 아래로 이동 : ctrl + home or ctrl + end 10. 해당 코드의 맨 앞..

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import sys test_case = int(input()) members = [] count = 1 for case in range(test_case): age, name = sys.stdin.readline().strip().split() age = int(age) members.append([age, name, count]) count += 1 members = sorted(members, key=lambda x: (x[0], x[2])) for member in members: print(member[0], member[1]) cs

1 2 3 4 5 6 7 8 9 10 11 12 13 14 import sys test_case = int(input()) word_list = set() # 집합형 자료구조 사용 for case in range(test_case): word = sys.stdin.readline().strip() word_list.add(word) # set 자료구조에는 append가 아닌 add를 사용 # 단어의 길이로 정렬 + 길이가 같은 경우 사전순으로 word_list = sorted(word_list, key=lambda x: (len(x),x)) for word in word_list: print(word) Colored by Color Scripter cs # 중복된 단어 출력을 피하기 위해 set 자료구조..

1 2 3 4 5 6 7 8 9 10 11 import sys test_case = int(input()) xy_list = [] for case in range(test_case): x, y = list(map(int, sys.stdin.readline().strip().split())) xy_list.append([x,y]) a = sorted(xy_list, key= lambda x: (x[1],x[0])) for i in a: print(*i) Colored by Color Scripter cs # 두번째 열부터 정렬해야 하기 때문에 lambda 함수로 x[1], x[0]을 반환하여 정렬한다.

1 2 3 4 5 6 7 8 9 10 11 12 import sys test_case = int(input()) xy_list = [] for case in range(test_case): x, y = list(map(int, sys.stdin.readline().strip().split())) xy_list.append([x,y]) xy_list.sort() for i in xy_list: print(*i) Colored by Color Scripter cs + sort에는 key 값을 주어 여러가지 방법으로 정렬을 할 수 있다.

# collections 모듈의 Counter 메소드를 쓰지 않는 방법 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 import sys max_size = 4000 # 입력되는 정수의 절댓값은 4000을 넘지 않는다. def artithmetic_mean(num_list): # 산술평균 sum = 0 for i in num_list: sum += i return int(round(sum/len(num_list),0)) def median_value(num_list): # 중앙값 num_list.sor..
- Total
- Today
- Yesterday
- props를 변경하지 못하는 이유
- localhost https
- 댓글 모듈
- Redux Thunk
- 리액트 props
- 우아한테크코스
- 리액트 동작원리
- Python
- 인사이트
- 백준
- 파이썬
- 다라쓰
- 리액트 리스트 key
- 우테코
- 리덕스 썽크
- 프론트엔드
- React key
- 리액트 리덕스
- 리액트 리스트 키
- 해쉬 라우터
- mkcert
- contentEditable focus
- 리액트 키
- props를 변경하지 않는 이유
- 리액트 jsx
- 프론트
- 1463
- Hash Router
- Browser Router
- 브라우저 라우터
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |