Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: jamesz

Problemset: อนุกรม

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-24 21:26:34

#include<iostream>
#include<vector>
using namespace std;
typedef long long ll;
ll arr[101] = {0};
ll f(ll n){
	if(n<=1)
		return 1;
	if(arr[n]!=0)
 		return arr[n];
	arr[n] = f(n-1) + f(n-2);
	return f(n-1) + f(n-2);
}
int main(){
	ll n;
	cin.tie(0); ios::sync_with_stdio(false);
	cin>>n;
	cout<<fixed<<f(n-1); return 0;
}