| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 116917 | 陈家宝 | 放苹果 | C++ | Wrong Answer | 0 | 0 MS | 292 KB | 576 | 2023-12-20 14:03:48 |
#include<bits/stdc++.h> using namespace std; int mp[505][505],in[1000005],k=0; stack<int> st; void dfs(int x){ for(int i=1;i<=k;i++){ if(mp[x][i]){ mp[x][i]--; mp[i][x]--; dfs(i); } } st.push(x); } int main() { int n,m; cin>>n; for(int i=0,x,y;i<n;i++){ cin>>x>>y; k=max(k,max(x,y)); mp[x][y]++; mp[y][x]++; in[y]++,in[x]++; } int s=1061109567; for(int i=1;i<=k;i++){ if(in[i]%2==1) s=min(s,i); } if(s==1061109567)s=1; dfs(s); while(!st.empty()){ cout<<st.top()<<endl; st.pop(); } return 0; }