-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNo_10826.java
More file actions
30 lines (23 loc) · 768 Bytes
/
No_10826.java
File metadata and controls
30 lines (23 loc) · 768 Bytes
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
/*
Problem_10826_피보나치 수 4
https://www.acmicpc.net/problem/10826
*/
import java.io.*;
import java.math.BigInteger;
public class No_10826 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int n = Integer.parseInt(br.readLine());
br.close();
BigInteger[] fibo = new BigInteger[10001];
fibo[0] = BigInteger.valueOf(0);
fibo[1] = BigInteger.valueOf(1);
for (int i = 2; i <= n; i++) {
fibo[i] = fibo[i - 1].add(fibo[i - 2]);
}
bw.write(fibo[n] + "");
bw.flush();
bw.close();
}
}