P1011全RE求救!!
查看原帖
P1011全RE求救!!
1417687
niu114514楼主2025/1/19 21:31
#include<iostream>
#include<cmath>
#include<ctime>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cstdio>
//#include<bits/stdc++.h>
using namespace std;
#define jiba unsigned long long int

jiba s[101],a,n,m,x;
int febonaqi(jiba n)
{
	for(int i=3;i<=n;i++)
	{
		s[i]=s[i-1]+s[i-2];
	}
	//return a[n];
}

int main()
{
	cin>>a>>n>>m>>x;
	s[1]=s[2]=1;
	febonaqi(x);
	if(x==n)
	{
		cout<<s[x]*a-m;
		return 0;
	}
	cout<<s[x]*a-2;
	
	return 0; 
} 
2025/1/19 21:31
加载中...