QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#67092#5099. 朝圣道xlwangCompile Error//C++14643b2022-12-10 08:40:372022-12-10 08:40:39

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:40:39]
  • 评测
  • [2022-12-10 08:40:37]
  • 提交

answer

#include <bits/stdc++.h>
#include "pilgrimage.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;
}

详细

answer.code:26:5: error: ambiguating new declaration of ‘long long int ask(long long int)’
   26 | int ask(long long n){
      |     ^~~
In file included from answer.code:2:
pilgrimage.h:3:5: note: old declaration ‘int ask(long long int)’
    3 | int ask (long long n);
      |     ^~~