Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор harryb17, история, 14 месяцев назад, По-английски

In a recent codeforces contest round 892 question E(Maximum Monogonosity) I received a strange MLE on my solution which uses a 3D vector, but the same solution passed when I used a global declared 3D array. I know global declared arrays are faster than vectors and take slightly less size cause of the vector dynamic nature of doubling memory while using push_back. But none of this happened in the following code. can anyone please explain why this happened?

Note: No I didn't use any constant memory of vector for every test case, such that for 1e5 test cases it would fail.

my 3D array was n*k*5, where n & k are <= 3000. the constraints are tight and even while using globally declared array, it was 300Mb out of 512Mb, so that might give a hint why it might fail for vectors, but still, I think there might be a better reason.

Link to my:

Accepted Solution round 892 problem E

Memory Limit Exceeded Solution round 892 problem E

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

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится