CCCPaste

Untitled

#include 
#include 
#include 
using namespace std;
const int maxn = 1e5 + 10;

vector graph[maxn];
int main()
{
    int num_of_vertices;
    cin >> num_of_vertices;
    
    int num_of_edges;
    cin >> num_of_edges;
    
    for(int i = 0; i < num_of_edges; i++) {
        int a, b;
        cin >> a >> b;
        
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    
    for(int i = 0; i < num_of_vertices; i++) {
        for(int j = 0; j < (int) graph[i].size(); j++) {
            cout << i << " --> " << graph[i][j] << endl;
        }
    }
    

    
    return 0;

}