#include<bits/stdc++.h>
using namespace std;
// Function to add an edge to the graph
void addEdge(vector<vector<int>> &adjList, int u, int v) {
adjList[u].push_back(v); // Add v to u's list
}
// Function to print the adjacency list representation of the graph
void printGraph(const vector<vector<int>> &adjList) {
for (int i = 0; i < adjList.size(); i++) {
cout << "Vertex " << i << ":";
for (int j : adjList[i]) {
cout << " -> " << j;
}
cout << endl;
}
}
int main() {
int numVertices = 6; // Number of vertices in the graph
// Create an adjacency list
vector<vector<int>> adjList(numVertices);
// Add edges
addEdge(adjList, 2, 0);
addEdge(adjList, 2, 1);
addEdge(adjList, 2, 4);
addEdge(adjList, 2, 5);
addEdge(adjList, 3, 0);
addEdge(adjList, 3, 1);
addEdge(adjList, 3, 4);
addEdge(adjList, 3, 5);
addEdge(adjList, 4, 0);
addEdge(adjList, 4, 1);
addEdge(adjList, 5, 0);
addEdge(adjList, 5, 1);
// Print the adjacency list
printGraph(adjList);
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCi8vIEZ1bmN0aW9uIHRvIGFkZCBhbiBlZGdlIHRvIHRoZSBncmFwaAp2b2lkIGFkZEVkZ2UodmVjdG9yPHZlY3RvcjxpbnQ+PiAmYWRqTGlzdCwgaW50IHUsIGludCB2KSB7CiAgICBhZGpMaXN0W3VdLnB1c2hfYmFjayh2KTsgLy8gQWRkIHYgdG8gdSdzIGxpc3QKICAgIAp9CgovLyBGdW5jdGlvbiB0byBwcmludCB0aGUgYWRqYWNlbmN5IGxpc3QgcmVwcmVzZW50YXRpb24gb2YgdGhlIGdyYXBoCnZvaWQgcHJpbnRHcmFwaChjb25zdCB2ZWN0b3I8dmVjdG9yPGludD4+ICZhZGpMaXN0KSB7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IGFkakxpc3Quc2l6ZSgpOyBpKyspIHsKICAgICAgICBjb3V0IDw8ICJWZXJ0ZXggIiA8PCBpIDw8ICI6IjsKICAgICAgICBmb3IgKG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