UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#213799#2157. 数列zhangxinyang111Compile Error//C++455b2024-11-13 19:55:562024-11-13 23:04:04

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+7;
int f[N];
int n,p;
int qpow(int a,int b,int p)
{
	int ans=1;
	while(b)
	{
		if(b&1) ans=ans*a%p;
		a=a*a%p;
		b>>=1;
	}
	return ans;
}
signed main()
{
	cin.tie(nullptr) -> ios::sync_with_stdio(false);
	cin>>n>>p;
	f[1]=1;
	for(int i=2;i<=n;i++) f[i]=f[i-1]*(4*i-2)%p*qpow((i+1),p-2,p)%p;
	cout<<f[n]%p;
	return 0;
}
//f[n]=f[n-1]*(4*n-2)/(n+1)

详细

answer.code: In function 'int main()':
answer.code:20:10: error: 'nullptr' was not declared in this scope
  cin.tie(nullptr) -> ios::sync_with_stdio(false);\x0d
          ^