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

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

For problem E, this code, implemented using unordered_map, was giving MLE. So, I switched to 2D array. However, now this is giving TLE. Isn't 2D array faster than unordered_map? How is it giving TLE when the former isn't? Is it because of any UB?

Time complexity: O(n * k + total_t_len + q * k)

Space complexity: n* k * 4 bytes = 1000000 * 26 * 4 ≈ 100MB (fits comfortably in 512MB)

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

»
17 месяцев назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

I think that the unordered_map IS giving you TLE but it doesn't show cuz the memory limit exceeded