谷甚论CE
  • 板块灌水区
  • 楼主Prean
  • 当前回复15
  • 已保存回复15
  • 发布时间2020/5/28 18:14
  • 上次更新2023/11/7 01:33:58
查看原帖
谷甚论CE
160839
Prean楼主2020/5/28 18:14

这段代码莫名其妙CE了,求查错QAQ

#include<cstring>
#include<cstdio>
typedef long long ll;
const ll M=5e5+5,mod=998244353ll,inv=499122177ll;
const ll Cor[2][2]={{1,0},{1,1}},Ior[2][2]={{1,0},{mod-1,1}};
const ll Cand[2][2]={{1,1},{0,1}},Iand[2][2]={{1,mod-1},{0,1}};
const ll Cxor[2][2]={{1,1},{1,mod-1}},Ixor[2][2]={{inv,inv},{inv,mod-inv}};
ll n,f[M],g[M],a[M],b[M];
void FWT(ll*a,int n,ll**c){
	int i,p,len;
	for(len=1;len<n;len<<=1){
		for(p=0;p<n;p+=len<<1){
			for(i=p;i<p+len;++i){
				ll s0=a[i],s1=a[i+len];
				a[i]=(c[0][0]*s0+c[0][1]*s1)%mod;
				a[i+len]=(c[1][0]*s0+c[1][1]*s1)%mod;
			}
		}
	}
}
void times(ll*a,ll*b,int n,ll**C,ll**IC){
	FWT(a,n,C);FWT(b,n,C);
	for(int i=0;i<n;++i)a[i]=a[i]*b[i]%mod;
	FWT(a,n,IC);
}
void print(ll*a,int n){
	for(int i=0;i<n;++i)printf("%lld ",a[i]);
	printf("\n");
}
signed main(void){
	int i;scanf("%lld",&n);n=1<<n;
	for(i=0;i<n;++i)scanf("%lld",f+i);
	for(i=0;i<n;++i)scanf("%lld",g+i);
	memcpy(a,f,n<<3);memcpy(b,g,n<<3);times(a,b,n,Cor,Ior);print(a,n);
	memcpy(a,f,n<<3);memcpy(b,g,n<<3);times(a,b,n,Cand,Iand);print(a,n);
	memcpy(a,f,n<<3);memcpy(b,g,n<<3);times(a,b,n,Cxor,Ixor);print(a,n);
}

Dev报错cannot convert 'll (*)[2]{aka long long int (*)[2]}' to 'll**{aka long long int**}' for argument '4' to'void times(ll*,ll*,int,ll**,ll**)'

2020/5/28 18:14
加载中...