Problem adjmatrix
User pIaceholder
Submission Time 2023-04-17 15:47:38
Score 0
Max Time N/A
Max Memory N/A

Compile Error

adjmatrix.cpp: In function ‘int main()’:
adjmatrix.cpp:8:19: error: temporary of non-literal type ‘std::vector<int>’ in a constant expression
8 | std::vector<std::vector<int>(nodes, 0)>(nodes, 0) mat;
| ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/vector:67,
from adjmatrix.cpp:2:
/usr/include/c++/9/bits/stl_vector.h:386:11: note: ‘std::vector<int>’ is not literal because:
386 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/9/bits/stl_vector.h:386:11: note: ‘std::vector<int>’ has a non-trivial destructor
adjmatrix.cpp:8:40: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Alloc> class std::vector’
8 | std::vector<std::vector<int>(nodes, 0)>(nodes, 0) mat;
| ^
adjmatrix.cpp:8:40: