I'll give you a two-part answer:
vector<...> v = *new vector<...>(...)
Basically, you shouldn't do this.
Vector does its own memory management, so there is no need for raw new. Also, in this line you allocate memory for a vector on the heap (which is only 12 or 24 bytes, depending on your system), then assign this vector to the vector v
on the stack (which might involve a copy of the contents of the whole vector). The vector on the heap is never deleted and thus the memory is leaked.
Better:
vector<vector<int>> graph = vector<vector<int>>(n, vector<int>(n, 0));
or just
vector<vector<int>> graph(n, vector<int>(n, 0));
Now the answer to your original question: The C++ standard started allowing >>
to close nested templates starting from C++11 (see this related question), so you need to configure your compiler to use at least the C++11 standard (normally using the -std=c++11 flag). However, nearly all recent compilers I know already use this standard by default.
For a more detailed answer you would need to tell us which IDE and compiler you use.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…