Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <string>
  4. #include <vector>
  5. #include <map>
  6. #include <algorithm>
  7. #include <set>
  8. #include <bitset>
  9.  
  10. using namespace std;
  11.  
  12. int main() {
  13. int n;
  14. cin >> n;
  15. vector <int> fb(n + 1);
  16. fb[0] = 0;
  17. fb[1] = 1;
  18. for(int i = 2; i <= n; i++){
  19. fb[i] = fb[i - 1] + fb[i - 2];
  20. }
  21. cout << fb[n - 1];
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement