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

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

Given a 2d array of N * M, find the max XOR of all elements of a sub-matrix. Problem Link.

N <= 10000 and M <= 20. Time limit: 1s. Memory limit: 256

I tried to go through all possible subarray [l...r] on M and calculated its xor. Then for each [l...r] I traversed all rows and then calculated the max xor of this [l...r]*Ni rectangle using trie.

When trie is implemented using struct I'm getting TLE. But, array implementation of trie is giving Accepted verdict. I don't understand what's the difference in time complexity. Isn't it the same?

TLE Solution
AC Solution

Also, I see that somebody has solved it without trie. How to solve it without trie?

Without TRIE solution

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

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

Автор cseshamim47, история, 20 месяцев назад, По-английски
  • Проголосовать: нравится
  • -26
  • Проголосовать: не нравится