Run time error anomaly


#1

Why is this showing a run time error?

vector<vector > Solution::solve(int A) {
vector<vector > ans;
for(int i=0;i<A;i++){
int n = pow(11,i);
while(n!=0)
{
ans[i].push_back(n%10);
n =n/10;
}
}
return ans;
}