편집 시간: 2022년 2월 9일 오후 6:13
코드
Algorithm/1003.py at main · Junroot/Algorithm
풀이
(n일 때 0의 개수) = (n-1일 때 0의 개수) + (n -2일 때 0의 개수)
(n일 때 1의 개수) = (n-1일 때 1의 개수) + (n -2일 때 1의 개수)
위의 점화식을 찾아내면 풀 수 있다.
편집 시간: 2022년 2월 9일 오후 6:13
Algorithm/1003.py at main · Junroot/Algorithm
(n일 때 0의 개수) = (n-1일 때 0의 개수) + (n -2일 때 0의 개수)
(n일 때 1의 개수) = (n-1일 때 1의 개수) + (n -2일 때 1의 개수)
위의 점화식을 찾아내면 풀 수 있다.