1025. Divisor Game https://leetcode.com/problems/divisor-game/ Divisor Game - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제를 푸는데 전혀 감이 오지 않아서 고민하다가 바로 Discussion으로 넘어갔다. class Solution: def divisorGame(self, n: int) -> bool: return n % 2 == 0 1. Top-Down 방식 1) n이 짝수일 때 Alice가 ..
338. Counting Bits https://leetcode.com/problems/counting-bits/ Counting Bits - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com # 나의 코드 class Solution: def countBits(self, n: int) -> List[int]: answer = [] for i in range(n+1): answer.append(bin(i)[2:].count('1')) return answer # Ti..
다이나믹 프로그래밍 : 큰 문제를 작게 나누고, 같은 문제라면 한 번씩만 풀어 문제를 효율적으로 해결하는 알고리즘 기법이다. - 중복되는 연산을 줄이자! - 메모리 공간을 약간 더 사용하면 연산 속도를 비약적으로 증가시킬 수 있다. - DP의 대표적인 예시 : 피보나치수열 다음 조건을 만족할 때 사용할 수 있다. 1) 큰 문제를 작은 문제로 나눌 수 있을 때 2) 작은 문제에서 구한 정답은 그것을 포함하는 큰 문제에서도 동일할 때 메모이제이션(Memoization) 기법 : 다이나믹 프로그래밍을 구현하는 방법 중 한 종류로, 한 번 구한 결과를 메모리 공간에 메모해두고 같은 식을 다시 호출하면 메모한 결과를 그대로 가져오는 기법 - 캐싱(Cashing)이라고도 함. 메모이제이션 기법은 어떻게 구현? ->..
- Total
- Today
- Yesterday
- 비트
- dijkstra algorithm
- 열혈 자료구조
- 파이썬 몫
- 코딩테스트
- unsigned
- 프로그래머스
- leetcode
- 이코테
- 이것이코딩테스트다
- 해시
- scanf
- 파이썬 나머지
- C언어
- sizeof
- 동적 계획법
- dp
- C
- Python
- 파이썬
- 기본 자료형
- 비트연산자
- ascii
- 자료구조
- 에러
- 내장 함수
- 다익스트라 알고리즘
- dynamic programming
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |