diff --git a/fibonacci/fibonaci.cpp b/fibonacci/fibonaci.cpp new file mode 100644 index 00000000..be7f17a2 --- /dev/null +++ b/fibonacci/fibonaci.cpp @@ -0,0 +1,64 @@ +#include + +using namespace std; + +#define ar array +#define ll long long +#define ld long double +#define sza(x) ((int)x.size()) +#define all(a) (a).begin(), (a).end() + +const int MAX_N = 1e5 + 5; +const ll MOD = 1e9 + 7; +const ll INF = 1e9; +const ld EPS = 1e-9; +// || || || || || || || || || || || || || || || +// || || || || || || || +// || || || || || || || || || || +// || || || || || +// || || || || || || || || || || || +void setIO(){ + fast: + #ifndef ONLINE_JUDGE + freopen("input.txt", "r", stdin); + freopen("output.txt", "w", stdout); + #endif +} +int n=5; +vector Fib(n,-1); +int fibonaci(int n){ + if(n==0){ + Fib[n]=0; + return 0; + } + else if(n==1){ + Fib[1]=1; + return 1; + } + else if(Fib[n]==-1){ + // fibonaci(n-1); + // fibonaci(n-2); + Fib[n]=fibonaci(n-1)+fibonaci(n-2); + // cout<> tc; + solve(); + for (int t = 0; t < n; t++) { + cout<