Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<queue>
- #include <vector>
- using namespace std;
- int main()
- {
- int k;
- cin >> k;
- vector<int> graph[k + 1];
- for(int i = 0; i < k - 1; i++) {
- int a, b;
- cin >> a >> b;
- graph[a].push_back(b);
- graph[b].push_back(a);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement