本地成功编译输出正确,提交编译失败?
查看原帖
本地成功编译输出正确,提交编译失败?
777809
IOI_AK_TLR楼主2023/7/8 10:14

提交记录 代码:

#include <bits/stdc++.h>
using namespace std;
const int MAXN=1e7;
int p,len=1;
short a[MAXN]={0,1};
int main()
{
	cin>>p;
	for(int i=1;i<=p;i++)
	{
		int yu=0;
		for(int j=1;j<=len;j++)
		{
			a[j]*=2;
			a[j]+=yu;
			yu=a[j]/10;
			a[j]%=10;
		}
		if(yu)
		{
			a[++len]=yu;
		}
	}
	cout<<len<<'\n';
	a[1]-=1;
	for(int i=500;i>=1;i--)
	{
		if(i<500&&i%50==0)
			cout<<'\n';
		if(i>len)
			cout<<0;
		else
			cout<<a[i];
	}
	return 0;
}
2023/7/8 10:14
加载中...