fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define el "\n"
  4. #define ll long long
  5. #define ull unsigned long long
  6. #define se second
  7. #define fi first
  8. #define be begin()
  9. #define en end()
  10. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  11. ll f[1000];
  12. int main()
  13. {
  14. Faster;
  15. ll n; cin >> n;
  16. f[0] = 0;
  17. f[1] = 1;
  18. for(int i = 2; i <1000; i++)
  19. {
  20. f[i] = f[i-1] + f[i-2];
  21. if(f[i] == n || n == 0)
  22. {
  23. cout << "yes";
  24. return 0;
  25. }
  26. if(f[i] > n)
  27. {
  28. cout << "no";
  29. return 0;
  30. }
  31. }
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 5284KB
stdin
39088169
stdout
yes