QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#67091#5099. 朝圣道xlwangCompile Error//C++14618b2022-12-10 08:37:052022-12-10 08:37:06

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-10 08:37:06]
  • 评测
  • [2022-12-10 08:37:05]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define fr(i,j,k) for(register int i=j;i<=k;++i)
const int Maxn=3e3+20;
int f[Maxn][Maxn<<1];
int c[Maxn][Maxn];
inline int ksm(int x,int y,int mod){
	int sum=1;
	while(y){
		if(y&1) sum=sum*x%mod;
		y=y/2;
		x=x*x%mod;
	}
	return sum;
}
int mod;
void init(int o, int p){
	mod=p;
	f[0][3005]=1;
	int p1,p2,p3;
	p1=p3=ksm(4,p-2,p);
	p2=ksm(2,p-2,p);
	fr(i,1,3000) fr(j,1,6020) f[i][j]=(f[i-1][j]*p2%p+f[i-1][j-1]*p3%p+f[i-1][j+1]*p1%p)%p;
}
int ask(long long n){
	int ans=0;
	fr(i,1,6020) ans+=abs(i-3005)*f[n][i]%mod,ans%=mod;
	return ans;
}

详细

/usr/bin/ld: /tmp/ccqbsr11.o: in function `main':
implementer.cpp:(.text.startup+0x2b): undefined reference to `init(int, int)'
collect2: error: ld returned 1 exit status