Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <string>
- #include <vector>
- #include <map>
- #include <algorithm>
- #include <set>
- #include <bitset>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- vector <int> fb(n + 1);
- fb[0] = 0;
- fb[1] = 1;
- for(int i = 2; i <= n; i++){
- fb[i] = fb[i - 1] + fb[i - 2];
- }
- cout << fb[n - 1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement