0_0_20613134_25366.cpp:18:5: error: 's' does not name a type
s) dp[i][j]=(dp[i-1][j]*bina[pos])%M; } else dp[i][j]=(dp[i-1][j]*left(i,pos))%M; if(bina[pos]&sa[i]) { if(i!=s) { if(j) dp[i][j]=(dp[i][j]+dp[i-1][j-1]*left(i,pos))%M; } } } ll res=0; for(int i=0;i<num;i++) if((i&1)==need) res=(res+dp[n][i])%M; return res; } int main(){ init(); while(~scanf("%d%d",&n,&k)) { if(n+k==0) break; for(int i=1;i<=n;i++) scanf("%d",&sa[i]); memset(sum,0,sizeof(sum)); for(int pos=0;pos<=m;pos++) { ll tmp=bina[pos]; num=Sum1(tmp); int need; if(k&tmp) need=1; else need=0; for(int i=0;i<=n;i++) if(!i||(tmp&sa[i])) sum[pos]=(sum[pos]+Cal(pos,num,i,need))%M; } printf("%I64d\n",sum[m]); } return 0;}
^
0_0_20613134_25366.cpp:18:75: error: expected declaration before '}' token
s) dp[i][j]=(dp[i-1][j]*bina[pos])%M; } else dp[i][j]=(dp[i-1][j]*left(i,pos))%M; if(bina[pos]&sa[i]) { if(i!=s) { if(j) dp[i][j]=(dp[i][j]+dp[i-1][j-1]*left(i,pos))%M; } } } ll res=0; for(int i=0;i<num;i++) if((i&1)==need) res=(res+dp[n][i])%M; return res; } int main(){ init(); while(~scanf("%d%d",&n,&k)) { if(n+k==0) break; for(int i=1;i<=n;i++) scanf("%d",&sa[i]); memset(sum,0,sizeof(sum)); for(int pos=0;pos<=m;pos++) { ll tmp=bina[pos]; num=Sum1(tmp); int need; if(k&tmp) need=1; else need=0; for(int i=0;i<=n;i++) if(!i||(tmp&sa[i])) sum[pos]=(sum[pos]+Cal(pos,num,i,need))%M; } printf("%I64d\n",sum[m]); } return 0;}
^
|