Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Issue with Resizing 2D Vector

Revision en1, by AlTarek, 2023-05-13 12:42:30

in this Problem https://codeforces.com/contest/1829/problem/E

I Got a runTime Error because of this way of resizing my vector

grid.resize(n, vector(m));

but when I used this

grid = vector<vector>(n, vector(m));

it worked ?! What is the difference?

https://codeforces.com/contest/1829/submission/205458152 => Runtime Error

https://codeforces.com/contest/1829/submission/205697075 => Acc

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English AlTarek 2023-05-13 12:42:30 451 Initial revision (published)