You are viewing a single comment's thread. Return to all comments →
#include <bits/stdc++.h> using namespace std; int main(){ int m; int n; cin >> m >> n; for(int i = 0; i < n; i++) { int a; int b; cin >> a >> b; if((a==m)) m=b; else if (b==m) m=a; } cout<<m; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Where's the Marble?
You are viewing a single comment's thread. Return to all comments →