QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#67274#5099. 朝圣道Schi2oidCompile Error//C++14443b2022-12-10 11:20:192022-12-10 11:20:23

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:20:23]
  • 评测
  • [2022-12-10 11:20:19]
  • 提交

answer

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

Details

answer.code:3:9: error: two or more data types in declaration of ‘dp’
    3 | typedef int long long
      |         ^~~
answer.code: In function ‘void init(int, int)’:
answer.code:9:9: error: ‘dp’ was not declared in this scope; did you mean ‘p’?
    9 |         dp[0][0]=1;
      |         ^~
      |         p
answer.code:12:56: error: ‘mod’ was not declared in this scope; did you mean ‘modf’?
   12 |                 dp[i][0]=(dp[i-1][0]*ny+dp[i-1][1]*ny)%mod;
      |                                                        ^~~
      |                                                        modf