import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
static int dp[];
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
br.close();
dp = new int[1001];
dp[1] = 1;
dp[2] = 2;
for(int i = 3; i <= n; i++) {
dp[i] = (dp[i-1] + dp[i-2]) % 10007;
}
System.out.print(dp[n]);
}
}
'알고리즘' 카테고리의 다른 글
백준 11656 : 접미사 배열 자바 (0) | 2021.09.20 |
---|---|
백준 1463번: 1로 만들기 자바 (0) | 2021.09.12 |
백준 10992번: 별 찍기 - 17 자바 (0) | 2021.09.11 |
백준 10991번: 별찍기 - 16 자바 (0) | 2021.09.11 |
백준 2445번 : 별 찍기 -8 (0) | 2021.09.10 |