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