Sexy_stack's blog

By Sexy_stack, 2 hours ago, In English

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.

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
114 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

probably because of upperbound and lowerbound

»
54 minutes ago, # |
  Vote: I like it +1 Vote: I do not like it

because there is extra $$$0$$$ at $$$k$$$'th index, the vectors are not sorted