Codeforcer's blog

By Codeforcer, history, 3 years ago, In English

I was attempting this problem :

https://mirror.codeforces.com/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!

  • Vote: I like it
  • 0
  • Vote: I do not like it