QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#67277#5099. 朝圣道Schi2oidCompile Error//C++14468b2022-12-10 11:21:132022-12-10 11:21:18

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:21:18]
  • 评测
  • [2022-12-10 11:21:13]
  • 提交

answer

#include <bits/stdc++.h>
#include "pilgrimage.h"
using namespace std;
typedef int long long
int dp[3005][3005];
int ans[3005];
void init(int o, int p)
{
	int ny=(p+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:4:9: error: two or more data types in declaration of ‘dp’
    4 | typedef int long long
      |         ^~~
answer.code: In function ‘void init(int, int)’:
answer.code:10:9: error: ‘dp’ was not declared in this scope; did you mean ‘p’?
   10 |         dp[0][0]=1;
      |         ^~
      |         p
answer.code:13:56: error: ‘mod’ was not declared in this scope; did you mean ‘modf’?
   13 |                 dp[i][0]=(dp[i-1][0]*ny+dp[i-1][1]*ny)%mod;
      |                                                        ^~~
      |                                                        modf