蒟蒻37pts求调
查看原帖
蒟蒻37pts求调
959624
grind楼主2024/4/1 13:14

代码如下

#include<bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
unsigned long long f[61];
int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n;
	n=read();
	f[0]=1;
	f[1]=1;
	f[2]=2;
	for(int i=3;i<=60;i++)f[i]=f[i-1]+f[i-2]+f[i-3]; 
	printf("%u",f[n]);
	//fclose(stdin);
	//fclose(stdout);
	return 0;
} 

请dalao们帮帮本蒟蒻

2024/4/1 13:14
加载中...