5AC5WA求助!!!
查看原帖
5AC5WA求助!!!
565707
mediocre_楼主2023/7/19 09:42

看了月落乌啼算钱的启发

#include <bits/stdc++.h>
using namespace std;
const int N = pow(10, 9) + 7;
int main() {
	long long a;
	scanf("%lld", &a);
	long long c = (pow(((1 + sqrt(5)) / 2), a) -  pow(((1 - sqrt(5)) / 2), a)) / sqrt(5);
    printf("%lld", c % N);
	return 0;
}
2023/7/19 09:42
加载中...