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://codeforces.net/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://codeforces.net/contest/2036/submission/289685019
Please help me I am not able to get through it.
probably because of upperbound and lowerbound
because there is extra $$$0$$$ at $$$k$$$'th index, the vectors are not sorted