求助,RE,没有输出

P2731 [USACO3.3] 骑马修栅栏 Riding the Fences

求助大佬
by Yoo_ @ 2019-01-22 21:55:19


@[我的智商贼低](/space/show?uid=114677) 哈哈哈
by 一飞冲天666 @ 2019-01-22 22:08:16


@[我的智商贼低](/space/show?uid=114677) ```cpp #include<bits/stdc++.h> using namespace std; int G[101][101]; int du[101] int n,m,tot; int ans[510]; void dfs(int x){ for(int i=1;i<=m;i++){ if(G[x][i]>0){ G[x][i]-- G[i][x]--; dfs(i); } } ans[++tot]=x; } int main(){ cin>>n; for(int i=1;i<=n;i++){ int x,y; cin>>x>>y; G[x][y]++ G[y][x]++; du[x]++ du[y]++; m=max(max(x,m),y); } int p=1,cnt=0,flag=1; for(int i=1;i<=m;i++){ if(du[i]%2==1){ cnt++ if(flag){ p=i; flag=0 } p=i; break; } } // if(cnt>2){ // cout<<"no" // return; // } dfs(p); for(int i=tot;i>1;i--){ cout<<ans[i]<<endl; } return 0; } ``` 希望更丰富的展现?使用Markdown
by 施一公 @ 2019-03-09 11:39:59


@[我的智商贼低](/space/show?uid=114677) 有坑勿喷,自己编译运行一下就好了
by 施一公 @ 2019-03-09 11:43:58


@[施一公](/space/show?uid=98957) ...
by Yoo_ @ 2019-03-09 11:44:20


希望更丰富的展现?使用Markdown
by 施一公 @ 2019-03-09 11:50:05


|