https://www.luogu.com.cn/record/36747064
https://www.luogu.com.cn/record/36747178
只因为——
memset(vis,0,sizeof(vis));
memset(fa,0,sizeof(fa));
memset(dep,0,sizeof(dep));
memset(head,0,sizeof(head));
path=cnt=0;
for(int i=1;i<=n;i++)
buc[i].clear();
便乘了
path=cnt=0;
for(int i=1;i<=n;i++)
{
buc[i].clear();
vis[i]=fa[i]=dep[i]=head[i]=0;
}
请问这是为什么,memset
和循环赋值有不应该是一样的吗QAQ?
如果不一样,求什么时候用 memset
比普通循环快?