vector<vector> mat(k + 1, vector(n + 1, 0)); for (int i = 0; i < n; i++) { for (int j = 0; j < k; j++) { mat[j][i] = v[i][j]; } } // submission id https://mirror.codeforces.com/contest/2036/submission/289685104
this part give wrong answer when I use extra elements just to be safe from out of bounds but
vector<vector> mat(k + 1, vector(n + 1, 0)); for (int i = 0; i < n; i++) { for (int j = 0; j < k; j++) { mat[j][i] = v[i][j]; } } this works perfectly . // submission id https://mirror.codeforces.com/contest/2036/submission/289685019
Please help me I am not able to get through it.