The direct access works because you've reserved the space,
and it is faster since it does not involve a function call,
unless perhaps push_back is inlined.
For such similar programs it's better to use an #ifdef:
Code:
#define USE_PUSH  true   // at top of program

//         . . .

#ifdef USE_PUSH
    mtr[i].push_back(num);
#else
    mtr[i][j] = num;
#endif