Fibonacci using matrix exponentiation

Sir I am getting an error of segmentation fault in my code can you correct my code

Your mistake

vector<vector<int>> fun;

       fun[1][1] = 0;
       fun[2][1] = 1;

your are using fun without initializing it
Correct Way to do

vector<vector<int>> fun(k+1,vector<int>(2));

       fun[1][1] = 0;

       fun[2][1] = 1;

Modified Code

I hope this helps