Код: Выделить всё
struct e{
int to,p,v;
e(int _to_,int _p_, int _v_) {to = _to_, p = _p_, v = _v_;}
};
vector edge[maxN];
e* ptr_arr[maxM]; //ptr array points to the struct object
for(int i=0; i
Подробнее здесь: [url]https://stackoverflow.com/questions/78470035/memory-issue-about-pointer-that-points-to-stdvector[/url]