版本比较
[图论]欧拉路径&&欧拉回路
正文
增加 5 行删除 5 行
42 行未改动434445464747484950515253545555565758597 行未改动6768697071717273747511 行未改动8788899091919293949513 行未改动10911011111211311311411511611742 行未改动
```cpp
#include<bits/stdc++.h>#define int long long #define int long longusing namespace std;
const int N=1e5+10;struct edge{ int v,next;}edges[N*2];int head[N],idx;int n,m; int n,m;
void add_edge(int u,int v){ idx++; edges[idx].v=v;7 行未改动 for(int i=head[u];i;i=head[u]){ int v=edges[i].v; head[u]=edges[i].next; dfs(v); } } stk[++top]=u; return;}
11 行未改动 std::ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); cin>>n>>m; for(int i=1;i<=m;i++){ cin>>st[i].u>>st[i].v; cin>>st[i].u>>st[i].v; } sort(st+1,st+m+1,cmp); for(int i=1;i<=m;i++){ add_edge(st[i].u,st[i].v);13 行未改动 while(top>0){ cout<<stk[top]<<" "; top--; }
return 0;}
```