Skip to content

Commit

Permalink
[Silver III] Title: 2×n 타일링, Time: 104 ms, Memory: 14352 KB -BaekjoonHub
Browse files Browse the repository at this point in the history
  • Loading branch information
2sojeong committed Sep 21, 2024
1 parent 45a3140 commit 3ca465a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 백준/Silver/11726. 2×n 타일링/2×n 타일링.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import java.io.*;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int arr[] = new int[n + 2];
arr[1] = 1;
arr[2] = 2;
for (int i = 3; i <= n; i++) {
arr[i] = (arr[i - 1] + arr[i - 2])%10007;
}
System.out.print(arr[n] % 10007);
}
}
32 changes: 32 additions & 0 deletions 백준/Silver/11726. 2×n 타일링/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# [Silver III] 2×n 타일링 - 11726

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

### 성능 요약

메모리: 14352 KB, 시간: 104 ms

### 분류

다이나믹 프로그래밍

### 제출 일자

2024년 9월 21일 17:17:57

### 문제 설명

<p>2×n 크기의 직사각형을 1×2, 2×1 타일로 채우는 방법의 수를 구하는 프로그램을 작성하시오.</p>

<p>아래 그림은 2×5 크기의 직사각형을 채운 한 가지 방법의 예이다.</p>

<p style="text-align: center;"><img alt="" src="https://onlinejudgeimages.s3-ap-northeast-1.amazonaws.com/problem/11726/1.png" style="height:50px; width:125px"></p>

### 입력

<p>첫째 줄에 n이 주어진다. (1 ≤ n ≤ 1,000)</p>

### 출력

<p>첫째 줄에 2×n 크기의 직사각형을 채우는 방법의 수를 10,007로 나눈 나머지를 출력한다.</p>

0 comments on commit 3ca465a

Please sign in to comment.