Why am I getting this error on executing my code? In it I am trying to implement an adjacency list for a graph.
#include <iostream>
#include<vector>
#include<stdio.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n,k,i,m=0;
cin >> n;
vector<int> mv[n];
for(i=0;i<n;i++)
{
for(m=0;m<n;m++)
{
scanf("%d",&k);
if(k>0)
mv[i].push_back(k);
}
}
cout << mv[0].at(0) << " ";
cout << mv[0].at(1) << " ";
cout << mv[0].at(2) << " ";
cout << mv[1].at(1) << " ";
cout << mv[2].at(1) << " ";
cout << mv[3].at(0) << " ";
}
return 0;
}