Блог пользователя baibhav_21

Автор baibhav_21, история, 2 года назад, По-английски

I was trying out a trie problem, and I was stuck on it for a long time, I had defined the trie using a vector and every time was submitting my answer with some minor changes it showed me memory limit exceeded, or sometimes it was even giving me a TLE, After a while, I changed my vector used in the definition of the trie to the array, and in the first go itself My submission got accepted and not only that with vectors I was having a runtime of around 1762 ms and Memory of around 524300 KB and with arrays they both got optimized to 1341 ms and 366400 KB.

Can anybody pls confirm me if arrays are faster than vectors or is there is something I am missing out?

The submission that is giving me the error (using vectors)- 180171998 The submission that is giving me an ac (using arrays)- 180172097

Полный текст и комментарии »

  • Проголосовать: нравится
  • -18
  • Проголосовать: не нравится