Codeforces and Polygon may be unavailable from May 23, 4:00 (UTC) to May 23, 8:00 (UTC) due to technical maintenance. ×

DON'T use std::unordered_map for Trie

Revision en1, by Naithani, 2020-05-07 16:48:39

Hey everyone, I was solving this trie problem. At first, I was trying to solve this using std::unordered_map which causes TLE, but then, I tried using static array, and then it worked fine.

Solution with std::unordered_map: link https://pastebin.com/LtLQ47fk

Spoiler

Solution using static array: (link) https://pastebin.com/BUDPhxXk

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Naithani 2020-05-07 16:55:26 215 Tiny change: ' solution?' -> ' solution?\n\nIs there something wrong?' (published)
en1 English Naithani 2020-05-07 16:48:39 657 Initial revision (saved to drafts)