I am a novice in competitive programming and I do not know how I can implement an optimal graph in c++ ?. Use a code of geekforgeeks but I do not know how to modify it correctly (it throws me segmentation fault). So far I have not found a site in which to learn how to implement them :(