Sexy_stack's blog

By Sexy_stack, 47 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.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it