Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
Tags
- 북리뷰
- 스택
- Computer science
- 알고리즘
- bfs
- c++
- 너비우선탐색
- 컴공과
- 자료구조
- cs
- 정석학술정보관
- coding
- 백준
- Stack
- DP
- 컴퓨터공학과
- 컴공
- 정석
- 오에스
- 개발
- 코테
- OS
- Operating System
- 그래프
- 문제풀이
- 브루트포스
- 구현
- vector
- 코딩
- 오퍼레이팅시스템
Archives
- Today
- Total
Little Jay
[C++] 백준 13303번 - 타일 장식물 본문
dp 시작
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
long long dp[85];
int n;
int main() {
cin >> n;
dp[0] = 0;
dp[1] = 1;
for (int i = 2; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 2];
}
cout << (dp[n] + dp[n - 1]) * 2 + (dp[n]) * 2 << endl;
return 0;
}
'알고리즘 > BOJ' 카테고리의 다른 글
| [C++] 백준 1744번 - 수 묶기 (0) | 2022.02.11 |
|---|---|
| [C++] 백준 15312번 - 이름 궁합 (0) | 2022.02.06 |
| [C++] 백준 7662번 - 이중 우선순위 큐(multiset) (0) | 2022.01.13 |
| [C++] 백준 1302번 - 베스트셀러 (0) | 2022.01.11 |
| [C++] 백준 2468번 - 안전영역 (0) | 2021.11.19 |
Comments