Created
June 8, 2020 07:18
-
-
Save DongguemYoo/71e432da61f4aa39bb58e72ee6392f31 to your computer and use it in GitHub Desktop.
[코딩테스트] 타일 장식물 python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//레벨 3은 에바인듯 한 1,2정도 수준임 | |
def solution(N): | |
answer = 0 | |
a1 = 1 | |
a2 = 1 | |
aList = [] | |
aList.append(a1) | |
aList.append(a2) | |
i =2 | |
//피보나치 수열 만들기 | |
for i in range(2,80): | |
aList.append(aList[len(aList)-2]+aList[len(aList)-1]) | |
if N == 1: | |
return 4 | |
else: | |
N -=1 | |
answer=aList[N - 1] * 2 + aList[N] * 4 | |
return answer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment