求助大佬,T了五个点
查看原帖
求助大佬,T了五个点
308854
tzl_Dedicatus545楼主2020/5/23 10:20
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#include <iostream>

using namespace std;

short ans[310000];

int main()
{
	ios::sync_with_stdio(0);
	
	int p;
	
	cin>>p;

	cout<<int(0.30103*p+1)<<endl;
	
	ans[0]=1;
	
	int jin=0;
	for(int i=0;i<p;++i)		
	{
		for(int j=0;j<5001;++j)	 
		{
			ans[j] = ans[j]+ans[j]+jin;
			jin = ans[j]/10;
			ans[j] = ans[j]%10;	
		}
	} 
	
	ans[0]--;
	
	int cnt10=0;			
	for(short i=499;i>=0;--i)
	{
		++cnt10;
		cout<<ans[i];
		if(cnt10==50)
		{
			cout<<endl;
			cnt10=0;
		}
	}
	
	
	return 0;
}
2020/5/23 10:20
加载中...