Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<algorithm>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
- /*fstream cin("input.txt");
- ofstream cout("output.txt");*/
- vector<long long> v;
- v.push_back(0);
- v.push_back(1);
- while (v.back() < 1e18) {
- v.push_back(v[v.size() - 1] + v[v.size() - 2]);
- }
- long long n;
- cin >> n;
- for (int i = 0; i < v.size(); i++) {
- if (v[i] == n) {
- cout << i;
- return 0;
- }
- }
- cout << -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement