๋ฌธ์
์ฝ๋
#include <iostream>
#include <vector>
#define ll long long
using namespace std;
ll dp[200];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
dp[0] = 0; dp[1] = 1; dp[2] = 1;
int n; cin >> n;
for (int i = 3; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 3];
}
cout << dp[n];
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 14502๋ฒ - ์ฐ๊ตฌ์ (0) | 2021.11.11 |
---|---|
[๋ฐฑ์ค,c++] 9465๋ฒ - ์คํฐ์ปค (0) | 2021.11.10 |
[๋ฐฑ์ค,c++] 14496๋ฒ - ๊ทธ๋,๊ทธ๋จธ๊ฐ ๋์ด (0) | 2021.11.07 |
[๋ฐฑ์ค,c++] 14490๋ฒ - ๋ฐฑ๋์ด (0) | 2021.11.07 |
[๋ฐฑ์ค,c++] 14467๋ฒ - ์๊ฐ ๊ธธ์ ๊ฑด๋๊ฐ ์ด์ 1 (0) | 2021.11.07 |
[๋ฐฑ์ค,c++] 14425๋ฒ - ๋ฌธ์์ด ์งํฉ (0) | 2021.11.07 |
๋๊ธ