QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#67278#5099. 朝圣道Schi2oidCompile Error//C++14472b2022-12-10 11:22:372022-12-10 11:22: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 11:22:39]
  • 评测
  • [2022-12-10 11:22:37]
  • 提交

answer

#include <bits/stdc++.h>
#include "pilgrimage.h"
using namespace std;
#define int long long
int dp[3005][3005];
int ans[3005];
void init(int o, int mod)
{
	int ny=(mod+1)/2;
	dp[0][0]=1;
	ans[0]=0;
	for(int i=1;i<=3000;i++){
		dp[i][0]=(dp[i-1][0]*ny+dp[i-1][1]*ny)%mod;
		for(int j=1;j<=i;j++) dp[i][j]=((dp[i-1][j-1]+dp[i-1][j+1])*ny%mod*ny%mod+dp[i-1][j]*ny%mod)%mod;
		ans[i]=(ans[i-1]+dp[i-1][0]*ny)%mod;
	}
}

int ask(long long n){return ans[n];}

詳細信息

answer.code:19:5: error: ambiguating new declaration of ‘long long int ask(long long int)’
   19 | int ask(long long n){return ans[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);
      |     ^~~