版本比较
心连心std
正文
增加 10 行删除 10 行
5 行未改动678910101112131461 行未改动7677787980808182838448 行未改动13313413513613713713813914014174 行未改动21621721821922022122222322022122222322422522622787 行未改动315316317318319320321319320321322323324325100 行未改动5 行未改动//#define debugdp1//#define debugres//#define debug2//#define debug3//#define debugloop //#define debugloop//#define debugREusing namespace std;const int N=100005;int n,loophead,looplen;61 行未改动#endif for(int i=0;i<g[u].size();i++) if(g[u][i]!=f[u]&&!onloop[g[u][i]]) { f[g[u][i]]=u; f[g[u][i]]=u; dfs0(g[u][i]); dp0[u]-=dp0[g[u][i]]; dp0[u]-=1;//send -1 }48 行未改动 detectloop(); for(int i=1;i<=n;i++) if(onloop[i]) dfs0(i); long long res,mark/*edge mark*/,u,opu,opm;
//caculation of all node_out1 type //start with loophead res=0; res+=dp1[loophead][1];74 行未改动 }#ifdef debugres cout<<'\n';#endif
//caculation of all node_out-1 type //start with loophead res=0; res+=dp1[loophead][0];87 行未改动 }#ifdef debugres cout<<'\n';#endif
//caculation of all loopedge type //start with loophead---f[loophead] res=1; mark=-1,u=f[loophead];100 行未改动