https://programmers.co.kr/learn/courses/30/lessons/12914?language=cpp
#include <string>
#include <vector>
#define DIV 1234567
using namespace std;
long long solution(int n) {
long long answer = 0;
vector<int> dp(n, 0);
if(n == 1)
return 1;
dp[0] = 1;
dp[1] = 2;
for(int i=2;i<n;i++){
dp[i] = (dp[i-2] + dp[i-1])%DIV;
}
return dp[n-1]%DIV;
}
#include<iostream>
#include<vector>
using namespace std;
int jumpCase(int num)
{
return num < 2 ? 1 : jumpCase(num - 2) + jumpCase(num - 1);
}
#include <string>
#include <vector>
#define DIV 1234567
using namespace std;
long long solution(int n) {
long long answer = 0;
int num[] = {1, 2};
if(n == 1)
return 1;
for(int i=2;i<n;i++){
int n = (num[0] + num[1])%DIV;
num[0] = num[1];
num[1] = n;
}
return num[1];
}