Created
April 26, 2023 05:22
-
-
Save modos/43eb1976a9d8cbcb57391707a048ed73 to your computer and use it in GitHub Desktop.
دومینوار
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the name of God | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int maxn = 1e4 + 10 , mod = 1e9 + 7; | |
int fib[maxn]; | |
int main() { | |
int n; | |
cin >> n; | |
fib[0] = fib[1] = 1; | |
for(int i = 2;i <= n;i++) | |
fib[i] = (fib[i-1] + fib[i-2]) % mod; | |
cout << fib[n] << '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment