Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

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

Автор omggg, 7 лет назад, По-английски

I want to use hash table of key : vector and value : int How can i use that ? Map<vector< int >,int> uses extra logn factor which many a times doesn't suite me and gives TLE. I just want to store frequency of a kind of vector.

Any help is appreciated. Thanks.

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

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

You are taking vector as a key value. There is whole extra factor of n where n is the size of the vector everytime you do operations with map.

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

Can you give link to the problem?

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

https://codeforces.me/blog/entry/62393?#comment-606294

You can do it by hashing the vector, but if you do that then the complexity will be $$$O(n^2/log$$$ $$$n)$$$, which is still too slow.