Submission

Status:

PPPPPPPPP-

Subtask/Task Score:

90/100

Score: 90

User: un8qe_x3

Problemset: Fibonacci Croissant

Language: cpp

Time: 0.003 second

Submitted On: 2025-11-16 13:48:15

#include <bits/stdc++.h>
using namespace std;

long long f(const int a) {
    const long double phi = (1.0L + sqrtl(5.0L)) / 2.0L;
    const long double psi = (1.0L - sqrtl(5.0L)) / 2.0L;
    return static_cast<long long int>(roundl((powl(phi, a) - powl(psi, a)) / sqrtl(5.0L)));
}

int main() {
    int a;long long int b=0;
    cin >> a;b += f(a);
    while (a--){b += f(a);}
    cout << b;
}