-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bronze I] Title: 피보나치 수, Time: 112 ms, Memory: 109240 KB -BaekjoonHub
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
|
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
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]) |