Skip to content

Commit

Permalink
[Bronze I] Title: 피보나치 수, Time: 112 ms, Memory: 109240 KB -BaekjoonHub
Browse files Browse the repository at this point in the history
  • Loading branch information
hmnd1257 committed Mar 16, 2024
1 parent 5677178 commit 80955ad
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
32 changes: 32 additions & 0 deletions 백준/Bronze/4150. 피보나치 수/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# [Bronze I] 피보나치 수 - 4150

[문제 링크](https://www.acmicpc.net/problem/4150)

### 성능 요약

메모리: 109240 KB, 시간: 112 ms

### 분류

임의 정밀도 / 큰 수 연산

### 제출 일자

2024년 3월 16일 17:36:37

### 문제 설명

<p>피보나치 수열은 다음과 같이 그 전 두 항의 합으로 계산되는 수열이다. 첫 두 항은 1로 정의된다.</p>

<p style="text-align: center;">f(1) = 1, f(2) = 1, f(n > 2) = f(n − 1) + f(n − 2)</p>

<p>정수를 입력받아, 그에 해당하는 피보나치 수를 출력하는 프로그램을 작성하여라.</p>

### 입력

Empty

### 출력

Empty

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
n = int(input())

data = [0, 1, 1]
for i in range(3, n + 1) :
data.append(data[i-1] + data[i-2])

print(data[n])

0 comments on commit 80955ad

Please sign in to comment.