Help->O(NlogN) giving TLE(4 s) in TRIE problem.

Правка en3, от Codeforcer, 2021-06-01 17:42:03

I was attempting this problem :

https://codeforces.me/contest/706/problem/D

I tried using trie and it gives TLE. I saw solutions of other people but most of them have created a TRIE by using struct and pointers. I have done it using a 2d next array following the idea from Errichto topic video of trie. I cant figure out why there is TLE, maybe because of map ? Any help would be appreciated.

Here is my code :

D

UPD Got accepted!

Thanks!

Теги trie, tle, help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Codeforcer 2021-06-01 17:42:03 27 Tiny change: 'oiler>\n\nThanks' -> 'oiler>\n\n**UPD** Got accepted! \n\nThanks'
en2 Английский Codeforcer 2021-06-01 16:35:10 1623 Tiny change: 'n\n~~~~~\n//Think simple yet elegant.\n#include' -> 'n\n~~~~~\n#include'
en1 Английский Codeforcer 2021-06-01 16:33:34 476 Initial revision (published)