版本比较
哈希
正文
增加 7 行删除 7 行
125 行未改动全部展开1261271281291301301311321331345 行未改动14014114214314414514414514614714814945 行未改动19519619719819919920020120220311 行未改动21521621721821921922022122222319 行未改动2432442452462472472482492502514 行未改动2562572582592602602612622632642 行未改动125 行未改动全部展开 } pp[0]=1; for(int i=1;i<=n;i++)pp[i]=pp[i-1]*p; for(int i=1;i<=n;i++)f[i]=f[i-1]*p+a[i]+11; for(int i=n;i>=1;i--)g[i]=g[i+1]*p+(a[i]^1)+11;//没有取反能过样例 8 分 for(int i=n;i>=1;i--)g[i]=g[i+1]*p+(a[i]^1)+11;//没有取反能过样例 8 分 int ans=0;// cout<<check(2,3)<<endl;// return 0; for(int i=1;i<=n;i++){5 行未改动 } if(check(i,i+1))ans+=l+1; } cout<<ans<<endl;
return 0;}```
45 行未改动
signed main(){ ios::sync_with_stdio(0); cin.tie(0),cout.tie(0);
cin>>n>>T>>q; h[0]=1; for(int i=1;i<=100000;i++)h[i]=(h[i-1]*(100000007)); for(int i=1;i<=T;i++){11 行未改动 int sz=0,p=1; int res=0; int tot=0; int t=0;
cin>>m; for(int i=1;i<=m;i++)cin>>qq[i]; for(int i=1,j=1;i<=q;i++){ int now=qq[j];19 行未改动 } if(j==m)j=1; else j++; }
if(q==t)cout<<0<<endl; else{ q-=t; ans=((int)q/m)*num;4 行未改动 else j++; } cout<<ans<<endl; }
return 0;}```
2 行未改动